Write a program that prompts the user to input a number. The program should display the corresponding day for the given number. For example, if the user types 1, the output should be Sunday. If the user types 7, the output should be Saturday.
Source Code
day = int(input("Enter a number from 1 to 7: "))
if day == 1:
print(day, "is Sunday")
elif day == 2:
print(day, "is Monday")
elif day == 3:
print(day, "is Tuesday")
elif day == 4:
print(day, "is Wednesday")
elif day == 5:
print(day, "is Thursday")
elif day == 6:
print(day, "is Friday")
elif day == 7:
print(day, "is Saturday")
else:
print("Wrong input! Please enter a number from 1 to 7.")
Output
Enter a number from 1 to 7: 5
5 is Thursday