Apr-19-2024, 08:52 AM
'join' don't use python class names for your function name, it will overload the original definition.
If at any future time you need the original definition of join, you will get the new definition instead.
The yield is a part of a generator and yields the current iteration value.
see: Generators
Example:
If at any future time you need the original definition of join, you will get the new definition instead.
The yield is a part of a generator and yields the current iteration value.
see: Generators
Example:
>>> def next_num(): ... numlist=[1,2,3,4,5,6,7,8] ... for x in numlist: ... yield x ... >>> for num in next_num(): ... print(num) ... 1 2 3 4 5 6 7 8 >>>