gpt4 book ai didi

python - 逗号分隔的变量赋值

转载 作者:太空狗 更新时间:2023-10-30 00:34:35 26 4
gpt4 key购买 nike

<分区>

有人可以向我解释第 4 行在做什么吗?

1 def fib2(n):  # return Fibonacci series up to n
2 ... """Return a list containing the Fibonacci series up to n."""
3... result = []
4... a, b = 0, 1 #this line
5... while a < n:
6... result.append(a)
7... a, b = b, a+b
8... return result

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com