Programming Examples

Python program using if Elif else statement to find the number of days present in a month


Write a Python program using if Elif else statement to find the number of days present in a month:

month=eval(input("Enter Month Sr. No (ex: for Jan enter - 1 ): "))
if month==1 or month==3 or month==5 or month==7 or month==8 or month==10 or month==10 :
    print("Number of days in Month are 31")
elif month==4 or month==6 or month==9 or month==11:
    print("Number of days in Month are 30")
else:
    print("Number of days in Month are 28 or 29")
Output

Enter Month Sr. No (ex: for Jan enter - 1 ): 4

Number of days in Month are 30

CCC Online Test 2021 CCC Practice Test Hindi Python Programming Tutorials Best Computer Training Institute in Prayagraj (Allahabad) Best Java Training Institute in Prayagraj (Allahabad) Best Python Training Institute in Prayagraj (Allahabad) O Level Online Test in Hindi Bank SSC Railway TET UPTET Question Bank career counselling in allahabad Sarkari Naukari Notification Best Website and Software Company in Allahabad Sarkari Exam Quiz