Skip to content

Instantly share code, notes, and snippets.

@gileno
Last active April 4, 2017 17:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gileno/ef11308b171d47cfe827955ef2db8f5d to your computer and use it in GitHub Desktop.
Save gileno/ef11308b171d47cfe827955ef2db8f5d to your computer and use it in GitHub Desktop.
Adivinha Araripina
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