python's for not like c++'s?

Eugene Goodrich bitbucket at isomedia.com
Tue Dec 28 02:22:52 EST 1999


>>>
for i in range (3, 10, 3):
	print i,
print
for i in range (9, 0, -3):
	print i,
<<<

range () functionality is explained in the Python HTML documentation
under "Library Reference -> 2.3 Built-in Functions".

    -Eugene


On Tue, 28 Dec 1999 01:33:30 -0500, jerry smith
<reio-ta at MailAndNews.com> wrote:

>for(int x=3;x<10;x+=3)
>	cout << x << " ";
>cout << endl;
>for(int y=9;y>0;y-=3)
>	cout << y<< " ";
>
>how would i do something similiar to this in python?
>all i see on the for loops for python are iterating through
>the whole sequence of a list. as far as i could see there doesnt
>seem to be an easy way to start somewhere in the middle of a
>list. also no way to iterate through a list other than the incrament
>by one and no decramenting through a list.
>please help?
>
>------------------------------------------------------------
> Get your FREE web-based e-mail and newsgroup access at:
>                http://MailAndNews.com
>
> Create a new mailbox, or access your existing IMAP4 or
> POP3 mailbox from anywhere with just a web browser.
>------------------------------------------------------------
>

import binascii; print binascii.a2b_base64 ('ZXVnZW5lQGlzb21lZGlhLmNvbQ==')



More information about the Python-list mailing list