Computer Science, asked by shrashtisohane, 4 months ago

write a program to display the name of the day according to the number given by the user​

Answers

Answered by TheMoonlìghtPhoenix
7

Explanation:

ANSWER:-

# Program to display name of the day

day = int(input("Enter the number of the day"))

If

day == "1":

print("The day is Monday")

elif

day == "2":

print("The day is Tuesday")

elif

day == "3":

print("The day is Wednesday")

elif

day == "4":

print("The day is Thursday")

elif

day == "5":

print("The day is Friday")

elif

day == "6":

print("The day is Saturday")

elif

day == "7":

print("The day is Sunday")

else

print("Invalid Input")

.

  • In this the structure used is if-elif-else.
  • != for not equal to
  • == for equal to.

Edit: Colons ( : ) added.

Similar questions