Question

How do I code these in Python? My final result should be "Monday 4" day =...

How do I code these in Python? My final result should be "Monday 4"

day = Monday

square = 2 ^ 2

print (square)

print(day + square)

Homework Answers

Answer #1

Explanation:

Here is the code which has the variable day in which the String "Monday" is stored.

sqaure variable stores the value of 2 to the power of 2, that is 4.

Then print statement is used to print day and square together as mentioned.

Code:

day = "Monday"

square = 2 ** 2
print(day +" "+ str(square))

Output:

PLEASE UPVOTE IF YOU FOUND THIS HELPFUL!

PLEASE COMMENT IF YOU NEED ANY HELP!

Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
Python Function: How to format phone number "9293827827" to "(929) 382-7827 in python. My code so...
Python Function: How to format phone number "9293827827" to "(929) 382-7827 in python. My code so far: phone_number = input("Enter phone number (numbers only): ") phone_number_formatted = ?????? print(phone_number_formatted)
How can I change my username so that the getuser Python output is different? I am...
How can I change my username so that the getuser Python output is different? I am using a windows pc import datetime import getpass print("\n\nFinished execution at ", datetime.datetime.now()) print(getpass.getuser())
""" ''' Write a python code to push all zeors to the end of an array...
""" ''' Write a python code to push all zeors to the end of an array ''' import numpy as np def Move_a(i):    num = len(a)    for k in range (i, num-1): a[k] = a[k+1] a[num-1] = 0    return a a = np.array([0,1,4,7,0,9,12,0,0,15,0,21]) #length of array (len) num = len(a) print (num) for i in range(0,num): if (a[i] == 0): #Functioon call to Move_a() a = Move_a(i)       print ("the array looks like") print (a) My...
Write code snippets to do the following. You should write these in a Python editor and...
Write code snippets to do the following. You should write these in a Python editor and test them out as you go. When they work, copy and paste your final code snippet here. Define a function that takes a total bill and the number of people at your table, and prints the amount that each person owes. e.g. divide_bill(100, 5) would produce Each person owes $20 for their meal. e.g. divide_bill(50.25, 4)would produce Each person owes $12.56 for their meal....
how should i run my data when i have 4 categories under 1 policy. should i...
how should i run my data when i have 4 categories under 1 policy. should i use dummy variable for each categories or should i average the 4 categories. this is my model export = β + β1adoption rate + β2 policy
how should i run my data when i have 4 categories under 1 policy. should i...
how should i run my data when i have 4 categories under 1 policy. should i use dummy variable for each categories or should i average the 4 categories. this is my model export = β + β1adoption rate + β2 policy
i need this code to print a number of stars depending on how much the user...
i need this code to print a number of stars depending on how much the user wants and after * it prints no stars. if the user enters a negative number it should print "error invalid number" this is my code so far: def stars(n,i): stars(n, 1) if n <= 0: return "No stars" if i <= n: print("* ", end="") stars(n, i + 1) else: print("no stars") stars(n - 1, 1) n = int(input("enter an integer")) def main(): stars()...
Python please debug each python block. Do not change the algorithm. You can add statements or...
Python please debug each python block. Do not change the algorithm. You can add statements or you can modify existing python statements. # 8) Duplicate characters that are NOT vowels. Output should be apppplle 20 points strobj = 'apple' def strformat(strobj): tempstr='' for i in strobj: if(i in ['a','e','i','o','u']): tempstr = tempstr + i*2    print(strformat(strobj))
I have to do a final poster using Microsoft Publisher for my Final paper Poster in...
I have to do a final poster using Microsoft Publisher for my Final paper Poster in Chemistry-100-301 Chemistry and Society. I have to write a paper on Nicotine in the brain. Who can assist me with this task? Thanks
I need python code for this. Write a program that inputs a text file. The program...
I need python code for this. Write a program that inputs a text file. The program should print the unique words in the file in alphabetical order. Uppercase words should take precedence over lowercase words. For example, 'Z' comes before 'a'. The input file can contain one or more sentences, or be a multiline list of words. An example input file is shown below: example.txt the quick brown fox jumps over the lazy dog An example of the program's output...