I am new to python and I was asked to do some exercises using while and for loop. I was asked to do a program loop until the request was requested by the user only by pressing <Return> . So far I:
User = raw_input('Enter <Carriage return> only to exit: ') running = 1 while running == 1: Run my program if User == # Not sure what to put here Break else running == 1
I tried: (as indicated in the exercise)
if User == <Carriage return>
and
if User == <Return>
but this leads to invalid syntax. Please could you advise me how to do this in the easiest way. Thanks
python while-loop
Candace
source share