Skip to content

Algorithme jugement dernier - Nathan Deroche#32

Open
NanaNana64 wants to merge 5 commits intobcalou:mainfrom
NanaNana64:main
Open

Algorithme jugement dernier - Nathan Deroche#32
NanaNana64 wants to merge 5 commits intobcalou:mainfrom
NanaNana64:main

Conversation

@NanaNana64
Copy link
Copy Markdown

No description provided.

@The17thDoctor
Copy link
Copy Markdown

Un vrai travail de délégué

@NanaNana64 NanaNana64 marked this pull request as draft November 15, 2023 14:34
@NanaNana64 NanaNana64 marked this pull request as ready for review November 17, 2023 10:20
Copy link
Copy Markdown
Owner

@bcalou bcalou left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bien

__main__.py Outdated
Comment on lines +11 to +14
if not is_valid_date(user_input):
continue

break
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Si on inverse la condition, la structure sera simplifiée

doomsday/date.py Outdated
# doesn't exist (for example : 2021-18-45), then return False and print
# an error message
except ValueError:
print("Incorrect date format. Please use the format YYYY-MM-dd.")
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Le commentaire et le comportement réel ne sont pas cohérents. Si je passe une date bien formatée mais inexistante, j'ai l'impression que j'aurai le message me disant que ma date est mal formatée, non ?

"""
Returns the day of the week for the given date in the format YYYY-MM-dd.
"""
from datetime import datetime
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Plutôt en haut du fichier


def get_doomsday_year(year: int) -> int:
"""Gets the doomsday of the year as an integer between 0 and 6"""
last_two_numbers_of_year: int = year % 100
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

numbers -> digits (plus précis, comme nombre VS chiffre en français)

@bcalou
Copy link
Copy Markdown
Owner

bcalou commented Nov 24, 2023

Le code est soigné mais le test sur l'algo lui-même ne passe pas.
Attention à bien vérifier les tests pour la suite, c'est essentiel.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants