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"
a=input()
if a=='Feb':
print("28 or 29")
if (a=='Jan') or (a=='Mar'):
print("31")
if a=='Apr':
print("30")
Comments
Post a Comment