[Tutor] Tutor Digest, Vol 58, Issue 2
W W
srilyk at gmail.com
Mon Dec 1 21:38:28 CET 2008
Try this:
for x in xrange(3, 0, -1):
....: print x
....:
....:
3
2
1
HTH,
Wayne
On Mon, Dec 1, 2008 at 2:20 PM, WM. <wferguson1 at socal.rr.com> wrote:
> 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 at python.org
> http://mail.python.org/mailman/listinfo/tutor
>
--
To be considered stupid and to be told so is more painful than being called
gluttonous, mendacious, violent, lascivious, lazy, cowardly: every weakness,
every vice, has found its defenders, its rhetoric, its ennoblement and
exaltation, but stupidity hasn't. - Primo Levi
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20081201/ec75925b/attachment.htm>
More information about the Tutor
mailing list