Apprendre Python - UPDATE 1.4-tp-bisextile.py: bonus perso hors énoncé

This commit is contained in:
Fred Z 2017-12-26 01:22:14 +01:00
parent 4985219cbe
commit d03d0a4d1f
1 changed files with 10 additions and 0 deletions

View File

@ -16,3 +16,13 @@ elif (annee % 4) == 0 and (annee % 100) != 0:
else:
print(annee," n'est PAS bisextile.")
liste = []
# La suite ne fait pas parti du TP: bonus perso
print("Voici la liste des annees bisextiles entre 1900 & 2030 :")
for a in range(1900,2030):
if ((a % 400) == 0) or ((a % 4) == 0 and (a % 100) != 0):
liste.append(a)
print(liste)