A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://mail.python.org/pipermail/python-list/2001-April/092125.html below:

Stepping backwards in for loop?

Stepping backwards in for loop?Robert Amesz rcameszREMOVETHIS at dds.removethistoo.nl
Sat Apr 14 15:39:35 EDT 2001
Gustaf Liljegren wrote:

> Can't figure out how to step backwards, character by character in a
> string. I was looking for a loop countruct with a counter to handle
> this, but the for loop in Python doesn't let me step backwards.
> What is the alternative? 
> 
> Gustaf

Python 2.0 (#8, Oct 16 2000, 17:27:58) [MSC 32 bit (Intel)] on win32
Type "copyright", "credits" or "license" for more information.
>>> for i in range(10,0,-1):
...    print i,
...
10 9 8 7 6 5 4 3 2 1
>>>


Now, that wasn't too hard, was it? ;-)

Another two bits of advice:
1 - As a Windows-user, pick up the Python documentation in HTML-help
    format (.CHM). It's somewhere on Robin Dunn's pages, IIRC. Being 
    able to search for keywords reaaly helps to speed things up.

2 - Totally unrelated to Python: upgrade to the latest Xnews, there's a
    new official release out, with a bucketload of new nifty features.
    You'll love it.


Robert Amesz

More information about the Python-list mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4