4/24

This is about the evolution of a function into a generator. The definition of this function refers to generating the nth number of a Fibonacci sequence. Learn about the problem of Fibonacci numbers here, Fibonacci numbers, also known as Fibonacci numbers. It is the Fibonacci sequence (Italian: Successione di Fibonacci), also known as the golden section sequence, Fibonacci sequence, Fibonacci number, Fibonacci sequence, which refers to such a sequence: 1, 1, 2 , 3, 5, 8, 13, 21, ... Mathematically, the Fibonacci sequence is defined recursively as follows: F0=0, F1=1, Fn=Fn-1+Fn-2 (n >=2, n∈N*), in literal terms, the Fibonacci sequence starts with 0 and 1, and the subsequent Fibonacci sequence coefficients are added by the previous two numbers.

This is the case of a generator. When converting return to yield, the value returned is the data type of the generator. To convert the data type of the generator is to convert the data of the generator to the data type of the iterator, which is Convert with next().

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324776049&siteId=291194637