Last active
April 4, 2017 17:40
-
-
Save gileno/ef11308b171d47cfe827955ef2db8f5d to your computer and use it in GitHub Desktop.
Adivinha Araripina
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import random | |
numero = random.randint(1, 100) | |
contador = 0 | |
while contador < 5: | |
print("Tentativa de número: ", contador) | |
chute = input("Digite um chute: ") | |
chute = int(chute) | |
if numero == chute: | |
print("Acertou!!!") | |
break | |
else: | |
diferenca = numero - chute | |
if diferenca < 5 and diferenca > -5: | |
print("Está quente") | |
else: | |
print("Está frio") | |
contador = contador + 1 | |
print("Fim do jogo") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment