Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #Exercice dictionnaire 3
- #Lucas Delvoye
- import random
- resultat = random.randint (1, 1000)
- b = 0
- tempmin = 1
- tempmax = 1000
- nbr_essais = 0
- while b != resultat:
- print ("***Le résultat est entre", tempmin, "et", tempmax, "***")
- b = int(input())
- print ("Le résultat est-il", b, "?")
- if b < resultat:
- print (" -Non il est plus grand")
- tempmin = b
- elif b > resultat:
- print (" -Non il est plus petit")
- tempmax = b
- else:
- print ("Oui\nPOGGERS!")
- print ("Seulement", nbr_essais, "essais!")
- print ("***------------------------------------------------------------***")
- nbr_essais += 1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement