def bidestile(a):
return False
def controllaData(g,m,a):
gm = [0,31,28,31,31,30,31,30,31,30,31,30,31]
if a < 1582:
return False
if m < 1 or m > 12:
return False
if bisestile(a) == True:
gm[2] = 29
if g < 1 or g > gm[m]:
return False
return True
g = int(input("Inserire il giorno\n"))
m = int(input("Inserire il mese\n"))
a = int(input("Inserire l'anno\n"))
if controllaData(g,m,a):
print("Data valida\n")
else:
print("Data non valida\n")
To embed this project on your website, copy the following code and paste it into your website's HTML: