Month Day and Year - Jan to May

Description:

The length of a month varies from 28 to 31 days. In this exercise you will create a program that reads the name of a month from the user as a string. Then your program should display the number of days in that month. Display 28 or 29 days for February so that leap years are addressed. The program should get input from Jan to Apr. If the input is from may to other months then display error messages as "Invalid" Note: Use only if and elif Test Case 1 Input (stdin) Jan Expected Output 31 Test Case 2 Input (stdin) Feb Expected Output 28 or 29

Program :


n=input()

if(n=='Jan'):

    print("31")

elif(n=='Feb'):

    print("28 or 29")

elif(n=='Mar'):

    print("31")

elif(n=='Apr'):

    print("30")

elif(n=='May'):

    print("31")

elif(n=='Jun'):

    print("30")

elif(n=='Jul'):

    print("31")

elif(n=='Aug'):

    print("31")

elif(n=='Sep'):

    print("30")

elif(n=='Oct'):

    print("31")

elif(n=='Nov'):

    print("30")

else:

    print("31")