Created
August 15, 2024 17:02
-
-
Save 3dgoose/41aaf4253193163fa48f0cdc410f73af to your computer and use it in GitHub Desktop.
A simulation where my sister steals money every 2 weeks.
This file contains hidden or 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
# Initialisation | |
argent = 20 | |
semaine = 0 | |
# Boucle de simulation | |
while True: | |
# Grand-père donne 10 $ | |
argent += 10 | |
# Soeur vole 3 $ | |
if semaine % 2 == 0: | |
argent -= 3 | |
# Incrémente la semaine | |
semaine += 1 | |
# Affiche la quantité d'argent | |
print(f"Après {semaine} semaine(s), vous avez {argent} $") | |
# Demande à l'utilisateur s'il veut continuer | |
continuer = input("Voulez-vous continuer ? (o/n) ") | |
if continuer == "n": | |
break |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment