Explicación paso a paso de este código

def mystery(n): a, b = 0, 1 while a < n: print (a) a, b = b, a + b 

Si alguien me puede dar una explicación línea por línea de este código, también informe de por qué no se ejecutará y qué código adicional debe agregarse.

Related of "Explicación paso a paso de este código"

 def mystery(n): # define a function named "mystery", that takes one argument called "n" a, b = 0, 1 # make a variable named "a" and set it to 0; make a variable named "b" and set it to 1 while a < n: # as long as "a" is smaller than "n" print (a) # display the value contained in "a" on the screen a, b = b, a + b # set "b" to the sum of "a" and "b"; set "a" to the old value of "b" (before it was set to the sum of "a" and "b")