|
@ -1,9 +1,19 @@ |
|
|
import datetime |
|
|
import datetime |
|
|
|
|
|
|
|
|
|
|
|
def estBissextile(date): |
|
|
|
|
|
date = date.split("-") |
|
|
|
|
|
if int(date[0])%4 == 0: |
|
|
|
|
|
return True |
|
|
|
|
|
else: |
|
|
|
|
|
return False |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def numeroJour(date): |
|
|
def numeroJour(date): |
|
|
"""renvoie un entier correspondant au numéro du jour correspondant (entre 1 et 365)""" |
|
|
"""renvoie un entier correspondant au numéro du jour correspondant (entre 1 et 365)""" |
|
|
try: |
|
|
try: |
|
|
day = datetime.datetime.strptime(date, "%Y-%m-%d") |
|
|
day = datetime.datetime.strptime(date, "%Y-%m-%d") |
|
|
|
|
|
print(estBissextile(date)) |
|
|
num_day = day.strftime('%j') |
|
|
num_day = day.strftime('%j') |
|
|
return int(num_day) |
|
|
return int(num_day) |
|
|
except(ValueError): |
|
|
except(ValueError): |
|
@ -22,3 +32,7 @@ def lecture(name): |
|
|
|
|
|
|
|
|
return lst_return |
|
|
return lst_return |
|
|
|
|
|
|
|
|
|
|
|
lecture("jeuTests.csv") |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|