Problem Description
The length of a month varies from 30 and 31 days.
In this exercise you will create a program that reads the name of a month from the user as a string.
The program should get input from May to August.
If the input is from may to other months then display error messages as "Invalid"
Note:
Use only if and elifCODING ARENA
month=input()
if(month=="Jun"):
print("30")
elif (month=="May","July","Aug"):
print("31")
else:
("Invalid")
Test Case 1
Input (stdin)May
Expected Output31
Test Case 2
Input (stdin)Jun
Expected Output30
✖
Share this Posts
Subscribe Our Newsletter
0 Comment
Post a Comment