When i run this code it doesn't have an output, and please can you explain the purpose of this code and give a line-by-line explanation of how it achieves its purpose.
def mystery(n):
a, b = 0, 1
while a < n
print (a)
a, b = b, a + b
I have also figured out how to make it output You add a line which is mystery(n) e.g. mystery(200)
I think it is like this:
• The first line defines a function with one parameter. The word “def” presents a function
definition. The function “def” must be followed by the function name e.g. mystery.
• The second line contains a multiple assignment. It is saying that the variable “a” is equal to 0 and “b” is equal to 1
• The function defines the value of “n”. On the third line “n” is undefined.
• The fourth line is to print (a)
• The fifth line makes