How to repeat a loop once it is finished

Denis McMahon denismfmcmahon at gmail.com
Thu Oct 15 10:27:58 EDT 2015


On Thu, 15 Oct 2015 06:29:24 -0700, abbasmo wrote:

> what would be a small thing that I could add to make this thing run
> again?

See what happens when you run the following code. Then adapt it to your 
application.

stop = False
while not stop:
    x = input("enter something, quit, stop or end to exit: ")
    print("you entered: ", x)
    if x in ["stop","quit","end"]:
        stop = True
print("Finished now")

-- 
Denis McMahon, denismfmcmahon at gmail.com



More information about the Python-list mailing list