[Tutor] Inverse range

Morten Juhl Johansen info at pythonin.dk
Wed Sep 6 16:34:17 CEST 2006


> You could do the folowing with range:
>
> for f in range(4,0,-1)
>     print f
>
> This should give you the wanted result. You start from 4 and range to 0
> (not
> included), by sustracting 1 each time.
>
> Cheers,
> Bas.

Thank you, Bastien and Kent.
Had tried:
for f in range(4,0):
   print f

- put obviously, something was missing.
It is good to be a beginner around people who say "read the manual" and
point to _where_ in the manual.

Yours,
Morten



More information about the Tutor mailing list