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.


_______________________________________________
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor

Reply via email to