def test(x):
for i in range(x):
yield i
for n in test(10):
print(n)
Python 3.6.6 (v3.6.6:4cf1f54eb7, Jun 27 2018, 03:37:03) [MSC v.1900 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> from operator import lt
>>> help(lt)
Help on built-in function lt in module _operator:
lt(...)
lt(a, b) -- Same as a<b.
>>>