I am making a python game of sorts and I am coming across an error. This error is saving previously user inputted data into a list even though I clear the list to the default hints at the start of the run.
The code looks like this:
pairLet = ["A#", "M*", "N%"]
letTer=input("Write a letter here (in capital letters) ")
symBol=input("Write a symbol here ")
if letTer or symBol in pairLet:
print("That letter/symbol is already in use")
print(pairLet)
else:
pairLet.append((letTer) + (symBol))
print(pairLet)
When I restart the code to enter the same letter and symbol pairing it shows this code:
Write a letter here (in capital letters) B
Write a symbol here ^
That letter/symbol is already in use
["A#", "M*", "N%"]
It prints the contents of the variable "pairLet" and the pairing inputted clearly aren't in there. How am I able to fix this?
Thanks -
Jake