I started learning python this week and was asking a few questions and in one has several different answers when the digits always return the same thing to me as if the others did not exist
This is the code:
from random import*
espaco = " "
Question_4 = "Eu estou pensando em um numero de 1 a 99. \nConsegue adivinhar ?"
Valor_maior = "Menos que isso"
Valor_menor = "Mais que isso"
def pergunta4():
number = randint(1,99)
print espaco
print Question_4
print espaco
resposta = raw_input ()
if resposta == resposta > number:
print espaco
print Valor_menor
print espaco
print pergunta4()
elif resposta == resposta < number:
print espaco
print Valor_maior
print espaco
print pergunta4()
elif resposta == number:
print espaco
print "E isso ae"
print espaco
print replay()
elif resposta == "desisto":
print espaco
print "ohh que pena o resultado era "
print number
print espaco
print replay()
def replay():
print espaco
print "Deseja brincar novamente ? (s/n)"
print espaco
decisao = raw_input ()
if decisao == "s":
print pergunta4()
if decisao == "n":
print "ok"
pergunta4()
I run to see if this good plus anything I type returns the same thing could help me?
The main idea was that it generated any number between 1 and 99 and if I said a larger number of what he did he would answer that the number is smaller and if I said a smaller number he would say it was bigger until I to fix the error more and basically this
Eu estou pensando em um numero de 1 a 99.
Consegue adivinhar ?
99999
Mais que isso
I said the number was 99999 and he said it was more than that plus the limit was 99 :( and no matter what the value always appears this yes I modified the code to help read