Getting a loop to activate a loop above it

Jordan Greenberg JordanGreenberg at gmail.com
Wed Mar 22 16:32:37 EST 2006


x=1
while not x==3:
    if x==1:
        print 'hello'
        x = input('what is x now?: ')
   if x==2:
        print 'hello again'
        x=input('what is x now?: ')

any code you want to repeat needs to be in some sort of a loop
structure. Program execution doesn't just jump around unless you tell
it to.

-- 
Jordan T. Greenberg
Spork Polisher




More information about the Python-list mailing list