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