[perl-python] 20050112 while statement

Xah Lee xah at xahlee.org
Thu Jan 13 05:18:26 EST 2005


# here's a while statement in python.

a,b = 0,1
while b < 20:
print b
a,b = b,a+b

---------------
# here's the same code in perl

($a,$b)=(0,1);
while ($b<20) {
print $b, "\n";
($a,$b)= ($b, $a+$b);
}


 Xah
 xah at xahlee.org
 http://xahlee.org/PageTwo_dir/more.html




More information about the Python-list mailing list