How to store information in variable arrays?
How would I store information in variables that I can go back later and compare? Such as
I just need to do this to compare a history to make sure a number hasn't already been entered earlier. But this is just a small example. I get nasty errors.
edit: that should work now We initialize a list first with text = . Then we just append each element to that list.
You can use the in operator:
If you choose to use a set instead of a list...
1 text = set()
...then the above test still works, but you'll use the add method on the set when adding numbers, not an append method.