Enter the number to print week day in Python

Source Code

num=int(input(“Enter the number from 1 to 7 : “))

if num==1:

    print(“Monday”)

elif num==2:

    print(“tuesday”)

elif num==3:

    print(“Wednesday”)

elif num==4:

    print(“Thursday”)

elif num==5:

    print(“Friday”)

elif num==6:

    print(“Saturday”)

elif num==7:

    print(“Sunday”)

else:

    print(“You enter number out of range”)

Output

Enter the number from 1 to 7 : 4

Thursday

Leave a Comment

Your email address will not be published. Required fields are marked *