python 寫斐波那契數列, 複合賦值很特別
a = 0
b = 1
c = 1
while c < 10:
print("fibonacci is", c)
c = a + b
a = b
b = c
print("a is", a)
print("b is", b)
'''
a = 0
b = 1
while b < 10:
print("fibonacci is ", b)
a, b = b, a + b
這裡複合賦值的邏輯是,先執行c= a+b, 然後是a=b , b=c '''