Hi all could someone tell me whats wrong with this code in python. Im trying to use if statements so that if a name isnt in the predefined list it will print false and ask to re-enter given name to delete, here is my code...please bear with me as im a n00b!

names = ["Ed", "Edd", "Eddy"]while 1: if not names: # if names is empty. exit() # exit python, use 'break' to escape the while loop if you don't wish to exit the script. a = raw_input ("Enter a name to remove: ") if a in names: # check if a is in names. names.remove(a) else: print a + " not found in names: " + names

The glass is neither half-full nor half-empty; it's merely twice as big as it needs to be.

Hi thanks for speedy reply.......Yes i want it to loop until ALL names are deleted, but say for instance if you mis-spell the name or forget to put a capital on the beginning of the name, then it should say "No such name, please re-enter"

Im trying to understand the IF statements better i know its something im missing that probs very simple but as im a n00b to this language i cant figure out.

Perhaps you can help me on this last thing........ I made a username and password in each tuple. From what ive been told and can make out myself the loop is checking the names fine, but doesnt acknowledge any password for each username, i can log in without entering anything....heres the code:

The reason I am Using lists and tuples is because of University. Else I would do differently. However thanks for the code you gave me I will try that more in the morning at the moment its not liking the pass function. :/ thanks for you help man, sorry for such n00bish questions, only been in programming a year to date now, so a long way to go.