while semantics

David Bear david.bear at asu.edu
Fri Mar 14 01:06:41 CET 2003

I think I'm confusing myself regarding semantics for a while loop.

while (conditionX):
   do something
    while (conditionY):
       do something else
          while (conditionZ):
               do something
               here conditionX becomes False
               print something
          print something else

Will the outer while loop cause all nested whiles to end as soon as 
conditionX is false? or will 'print something' be reached, then 'print 
something else' and so on untill it reaches the outer scope?

More information about the Python-list mailing list