> item = input() > if item != -1:
If you try this in the REPL, you'll see that 'item' is a string. You're trying to compare it to an integer, which will always fail. The cheapest way to fix this is probably: if item != '-1': Best, G -- https://mail.python.org/mailman/listinfo/python-list