-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDia_22.py
More file actions
29 lines (23 loc) · 802 Bytes
/
Dia_22.py
File metadata and controls
29 lines (23 loc) · 802 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
print ("Advinhe o numero de 0 - 1,000.000")
print ()
print ("Bora começar!")
import random
tentativas = 2
numero_correto = random.randint (1, 100)
while True:
numero_advinhado = int(input("Advinhe o numero: "))
if numero_advinhado > numero_correto:
print ("O numero correto é menor, tente novamente")
tentativas = tentativas + 1
if numero_advinhado < numero_correto:
print ("O numero correto é maior, tente novamente")
tentativas = tentativas + 1
elif numero_advinhado > numero_correto:
print ("O numero correto é menor, tente novamente")
continue
elif numero_advinhado == numero_correto:
print ("Parabens, voce acertou o numero correto!")
break
else:
print ("Algo deu errado")
print ("Você acertou o numero em", tentativas, "tentativas")