[Tutor] Tutor Digest, Vol 58, Issue 2

WM. wferguson1 at socal.rr.com
Mon Dec 1 21:20:03 CET 2008


Stooges.py

i,j,k = 3,3,3
while i != 1:
     print 'Larry, Moe & Curly Joe!'
     i -= 1
     while j != 1:
         print 'Go Mad!!'
         j -= 1
while k != 1:
     print 'Go-go bad-bad!!'
     k -= 1
print '\nBye-bye.'

I am trying to learn loops.  These nested 'whiles' work OK but I would 
like to wrap this script in a 'for' loop. I have not been able to make 
that work.




More information about the Tutor mailing list