-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDia_18.py
More file actions
29 lines (22 loc) · 778 Bytes
/
Dia_18.py
File metadata and controls
29 lines (22 loc) · 778 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 - 100")
print ()
print ("Bora começar!")
numero_correto = 42
tentativas = 1
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 ("Parabens, voce acertou o numero em", tentativas, "tentativas")