top of page

Python | Making a days dictionary only use if statement


Making a days dictionary only use if statement

#Program By eboostup.com
#Making a September days dictionary only use if statement
print("September days")
date=int(input("Enter the date and get day (YYYY-MM-DD) = 2021/08/"))
if date==1:
    print("Wednesday")
if date==2:
    print("Thursday")
if date==3:
    print("Friday")
if date==4:
    print("Saturday")
if date==5:
    print("Sunday")
if date==6:
    print("Monday")    
if date==7:
    print("Tuesday")
if date==8:
    print("Wednesday")
if date==9:
    print("Thursday")
if date==10:
    print("Friday")
if date==11:
    print("Saturday")
if date==12:
    print("Sunday")
if date==13:
    print("Monday")
if date==14:
    print("Tuesday")
if date==15:
    print("Wednesday")
if date==16:
    print("Thursday")
if date==17:
    print("Friday")
if date==18:
    print("Saturday")
if date==19:
    print("Sunday")
if date==20:
    print("Monday")
if date==21:
    print("Tuesday")
if date==22:
    print("Wednesday")
if date==23:
    print("Thursday")
if date==24:
    print("Friday")
if date==25:
    print("Saturday")
if date==26:
    print("Sunday")
if date==27:
    print("Monday")
if date==28:
    print("Tuesday")
if date==29:
    print("Wednesday")
if date==30:
    print("Thursday")
if date>30:
    print("Invalid Date")
else:
    print("Date = 2021/09/",date)    
print("Powered By eboostup.com")
#ankushdhingra


Comments

Rated 0 out of 5 stars.
No ratings yet

Add a rating
bottom of page