标签:logs efi tuple undefined 赋值 注意 python color span
def fib(max): n, a, b = 0, 0, 1 while n < max: print(b) a, b = b, a + b n = n + 1 return ‘done‘
注意,赋值语句:
a, b = b, a + b
相当于:
t = (b, a + b) # t是一个tuple
a = t[0]
b = t[1]
标签:logs efi tuple undefined 赋值 注意 python color span
原文地址:http://www.cnblogs.com/python3-study/p/6366525.html