-
-
Save PatWg/691e4964acf65bb8b5d973a0a1bdc97b to your computer and use it in GitHub Desktop.
ICC - Série 2 - Exercice 7
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
day: int = int(input("Jour: ")) | |
month: int = int(input("Mois: ")) | |
year_ex7: int = int(input("Année: ")) | |
nb_days_in_month: int = 0 | |
new_month: bool = True | |
for i in range(0, 14, 1): | |
print(f"Le cours numéro {i+1} aura lieu le {day}.{month}.{year_ex7}.") | |
if new_month: | |
if month in (1, 3, 5, 7, 8, 10, 12): | |
nb_days_in_month = 31 | |
elif month in (4, 6, 9, 11): | |
nb_days_in_month = 30 | |
else: | |
nb_days_in_month = 28 | |
new_month = False | |
if day + 7 > nb_days_in_month: | |
month += 1 | |
new_month = True | |
day = (day + 7) - nb_days_in_month | |
else: | |
day += 7 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment