PYTHON Learning 0037: Function --- write function generator with function --- 2019-7-2

Create a pattern generator has two kinds:
one, a list of formula: (i for i range () ), can only write the ternary operator.
2, with the function.

and return the difference between the yield:
. 1, the function returns the return value, and termination functions.
2, yield return data, and freeze the current execution.

Guess you like

Origin blog.51cto.com/13543767/2416139
Recommended