1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
| from random import randrange
cagnotte = int(input("Quelle est votre cagnotte de depart ? "))
mise = int(input("combien voulez-vous miser ? "))
while cagnotte >= 1:
print('Cagnotte = {}'.format(cagnotte))
x = randrange(49)
num = int(input("Choisir un nombre entre 0 et 49 "))
if num == x:
cagnotte = cagnotte - mise + (mise * 3)
print("Félicitation vous avez trouve le bon nombre, vous avez gagne", mise*3, "$")
# odd or even
elif (num % 2 == 0 and x % 2 == 0) or (num % 3 == 0 and x % 3 == 0):
cagnotte = cagnotte - mise + (mise/2)
print("Félicitation vous avez gagne", mise/2, "$")
else:
cagnotte = cagnotte - mise
print("Vous avez perdu toute votre mise")
print("Vous avez été élimine du tournoi") |
Partager