So i'm having problems with append function. It just doesn't add words to the list . What im trying to do is account login , where you can add new account what you can use when you login. This is just an example script put it works the same way. I'm trying to add new word to my mapp (example: Guido) and then i can use that word "guido" to get my program to print yay . So here's my example script:
mapp = ["example"]
example1 = raw_input("Enter Username: ")
if example1 in mapp:
print "yay"
else:
print ("Forgot Username eh?")
example = raw_input("Enter New Username: ")
if example not in mapp:
mapp.append(example)
So if anybody can help , help is appreciated . Thanks
setrather than alist. A set seems to be a more appropriate data structure for your intentions here. Additionally, you can get rid of theif example not in mapcheck. To use it, update your code tomapp = set(['example']), remove theif example not in mappline and changeappendtoadd.