diff --git a/lecture_csv.py b/lecture_csv.py index bf81159..c16a962 100644 --- a/lecture_csv.py +++ b/lecture_csv.py @@ -11,8 +11,10 @@ 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") - num_day = day.strftime('%j') - return int(num_day) + num_day = int(day.strftime('%j')) + if estBissextile(date) and num_day == 366: + num_day = 365 + return num_day except(ValueError): return None