Perl-Python Tutorial: “while” Loop Example

2005-01-12

Python

# python.

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

Python Doc

Perl

# perl

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

perldoc perlsyn

Was this page useful? If so, please do donate $3, thank you donors!
Home
Terms of Use
About
Advertise
Subscribe
Google
2005-01
© 2005 by Xah Lee.