-
-
Save bobo/3775798 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
# -*- coding: iso-8859-15 -*- | |
import sys | |
month=input ("Skriv in ett månadsnummer:") | |
if(month<1): | |
print "fealktig månad" | |
sys.exit(0) | |
day=input ("Skriv in ett dagnummer inom månaden:") | |
if(day<1): | |
print "felaktig dag" | |
sys.exit(0) | |
long_months = [1,3,5,7,8,10,11] | |
short_months = [4,6,9,11] | |
if month in long_months and day<32: | |
print "Korrekt" | |
elif month in short_months and day<31: | |
print "Korrekt" | |
elif month==2 and day<29: | |
print "Korrekt" | |
else: | |
print "Felaktigt" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment