I am trying to create a guessing game where I have a variable that gets a random value and then a while loop that requires me to type in a number. This should go on until I get the same value as the random generated one and then print out a list with all the numbers that I typed in. For some reason the loop goes on and on even when I do get the same number.
This is my code so far:
import random
x = random.randint(1,10)
y = []
lst = []
while y != x:
y = input('Your number:')
lst.append(y)
pass
print(lst)
Thank you!