circuitpython/tests/bytecode/mp-tests/yield1.py

18 lines
243 B
Python
Raw Normal View History

# generators and yield
def main():
def f():
print(123)
yield
print(456)
yield 2
print(789)
a = f()
print(a)
print(a.__next__())
print(a.__next__())
#print(a.__next__())
main()