Help ! newbie problem
ferdydurke
ferdy at ferdy.com
Fri Dec 26 15:04:25 EST 2003
hi,
I am trying to learn python... I can't explain the difference beetween these
two programms, Fibonacci suites :
>>> a,b,c = 1,1,1
>>> while c<12:
... print b,
... a,b,c = b,a+b,c+1
...
1 2 3 5 8 13 21 34 55 89 144
and
>>> a,b,c = 1,1,1
>>> while c<12:
... print b,
... a=b
... b=a+b
... c=c+1
...
1 2 4 8 16 32 64 128 256 512 1024
how about the instructions on the same block ? I thought they could be on
the other lines... perhaps I don't understand a=b and b=a+b ?
thanks in advance.
More information about the Python-list
mailing list