# using a dictionary values = {} x = input("Enter a number: ") while (x != 0): values[x] = True # Note that we can store any value we want into values[x] # here since we just need to put the key into the # dictionary. The actual value isn't important. x = input("Enter a number: ") print "The unique values entered were:" for i in values.keys(): print i