Skip to content

Instantly share code, notes, and snippets.

@3dgoose
Created August 15, 2024 17:02
Show Gist options
  • Save 3dgoose/41aaf4253193163fa48f0cdc410f73af to your computer and use it in GitHub Desktop.
Save 3dgoose/41aaf4253193163fa48f0cdc410f73af to your computer and use it in GitHub Desktop.
A simulation where my sister steals money every 2 weeks.
# 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