私が行っているチュートリアルには、次のプログラムがありました
# This program calculates the Fibonacci sequence
a = 0
b = 1
count = 0
max_count = 20
while count < max_count:
count = count + 1
old_a = a # we need to keep track of a since we change it
print(old_a,end=" ") # Notice the magic end=" " in the print function arguments that
# keeps it from creating a new line
a = b
b = old_a + b
print() # gets a new (empty) line
コードは完璧です。ただし、シーケンスの計算方法を理解できません。シーケンスを作成するために値をどのように変更しますか?