I am a beginner to python and I encountered a problem. This is what I wanted to do: If I I have 1 line that contains an input statement. while repeating the same line a few times by a loop, I want to store the data from the input and saving it from every repetition without loosing the previous data. after finishing the loop, I want to retrieve the data from all the iterations of the loop and then do something with each different data. In my case what I want to do is to compare the data. now the problem is that I were not able to save and store the data.
for i in range(2):
x = input("give me a letter")
if(x1==x2):
#the x1 and x2 are only for demonstrating that they should be different variables from x. they are not real syntax
print("you wrote the same letter twice!")
I tried to see if I can use the pickle model, but wasn't able to understand how to do so.