How can I know if there is already a number on a list?

0

I want to create a program in which you have to guess a "magic number", but I want to store the numbers entered in a list to know if you enter the number again and print a message that is: "The number already had been admitted ", something like my code so far:

lista_numero_magico = []
numero_magico = 20
lista_numero_magico.append(int( input( "Adivina el numero magico:" ) ) )


while numero_magico != lista_numero_magico
    print("Incorrecto, intentalo de nuevo,")
    lista_numero_magico.append(int( input( "Adivina el numero magico:" ) ) )
    if lista_numero_magico#que necesito aquí?
        print("Correcto, adivinaste!")
        break
    
asked by Manuel Rubio 18.07.2018 в 20:42
source

0 answers