On Thu, Sep 19, 2013 at 1:22 PM, William Bryant <gogobe...@gmail.com> wrote:
> It was the other functions above it. Thanks. but I tried to do the while
> loop - I don't think I did it right, I am novice in python and I am 13 years
> old.

It should be structured like this:

    while True:
        answer = input("Enter yes/no:")
        if answer in ('y', 'yes', 'new list'):
            do_yes_stuff()
            break
        elif answer in ('n', 'no', 'close'):
            do_no_stuff()
            break
        else:
            print("Please enter y or n.")

If they answer 'yes' or 'no', then the break statement breaks out of
the while loop.  Otherwise the while loop continues from the top and
asks them again.
-- 
https://mail.python.org/mailman/listinfo/python-list

Reply via email to