Yo je voudrais faire un simulateur de loto ou la réponse du joueur est aléatoire et écrire en combien d’essais les deux combinaisons étaient juste
Sauf que je n’ai pas de ouput
import random
esais = 0
while True :
tirage1 = random.randint(1,99)
tirage2 = random.randint(1,99)
tirage3 = random.randint(1,99)
tirage4 = random.randint(1,99)
tirage5 = random.randint(1,99)
tirage6 = random.randint(1,99)
nombre1 = random.randint(1,99)
nombre2 = random.randint(1,99)
nombre3 = random.randint(1,99)
nombre4 = random.randint(1,99)
nombre5 = random.randint(1,99)
nombre6 = random.randint(1,99)
esais += 1
if tirage1 == nombre1 and tirage2 == nombre2 and tirage3 == nombre3 and tirage4 == nombre4 and tirage5 == nombre5 and tirage6 == nombre6 :
print("Tu a gagner en ",esais,"esais")
break
Message édité le 06 septembre 2020 à 11:32:46 par Gogo8235