Created
November 8, 2016 12:26
-
-
Save MorkHub/b2d406d1ded6b5888dc2c78906d67a0f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
while True: | |
seasons = ["Winter","Spring","Summer","Autumn"] | |
months = [ | |
["December","January","February"], | |
["March","April","May"], | |
["June","July","August"], | |
["September","October","November"] | |
] | |
thirtyone = ["January","March","May","July","August","October","December"] | |
thirty = ["April","June","September","November"] | |
month = input(" 5. Enter a season: ",type=str).capitalize() | |
if month == 'Stop': | |
break | |
i = 0 | |
found = False | |
for season in months: | |
if month in season: | |
print(" %s is in %s." % (month,seasons[i]),end='') | |
if month in thirtyone: | |
print(" There are 31 days in %s" % month) | |
elif month in thirty: | |
print(" There are 30 days in %s" % month) | |
elif month == "February": | |
print(" There are 28 days in February") | |
found = True | |
i = i + 1 | |
if not found: | |
print(" %s is not a valid month." % month) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment