Skip to content

Instantly share code, notes, and snippets.

@PatWg

PatWg/s02e07.py Secret

Created September 25, 2023 14:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save PatWg/691e4964acf65bb8b5d973a0a1bdc97b to your computer and use it in GitHub Desktop.
Save PatWg/691e4964acf65bb8b5d973a0a1bdc97b to your computer and use it in GitHub Desktop.
ICC - Série 2 - Exercice 7
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