Write a python program that prompts the user to enter a number between 1-7 and then displays the corresponding day of the week.
PROGRAM:
a=int(input("Enter a number:"))
if (a==1):
print("Day of the week: Sunday")
elif (a==2):
print("Day of the week: Monday")
elif (a==3):
print("Day of the week: Tuesday")
elif (a==4):
print("Day of the week: Wednesday")
elif (a==5):
print("Day of the week: Thursday")
elif (a==6):
print("Day of the week: Friday")
elif (a==7):
print("Day of the week: Saturday")
else:
print("Invalid input...")
OUTPUT:
No comments:
Post a Comment