How do I code these in Python? My final result should be "Monday 4"
day = Monday
square = 2 ^ 2
print (square)
print(day + square)
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!
Get Answers For Free
Most questions answered within 1 hours.