Looping using iterators with fractional values

drife daranrife at yahoo.com
Sat Jan 1 15:05:29 EST 2005


Hello,

Making the transition from Perl to Python, and have a
question about constructing a loop that uses an iterator
of type float. How does one do this in Python?

In Perl this construct quite easy:

for (my $i=0.25; $i<=2.25; $i+=0.25) {
printf "%9.2f\n", $i;
}

Thanks in advance for your help.


Daran Rife
daranrifeUNS at PAMyahoo.com




More information about the Python-list mailing list