Skip to content

Instantly share code, notes, and snippets.

@LewkyB
Created September 17, 2014 20:38
Show Gist options
  • Save LewkyB/32f50f3f051425a82197 to your computer and use it in GitHub Desktop.
Save LewkyB/32f50f3f051425a82197 to your computer and use it in GitHub Desktop.
#Luke , Python , 9/17/2014
month = raw_input("Month: ").lower()
year = int(raw_input("Year: "))
month30 = ["september", "april", "june", "november"]
month31 = ["january", "march"]
month29 = ["february"]
if month in month30:
print "30 days"
elif month in month31:
print "31 days"
elif month in month29:
if year % 4 == 0 and year % 100 != 0 or year % 400 == 0:
print "29 days"
else:
print "28 days"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment