Code: Select all
@micropython.native
def myfunc():
for x in range(10):
yield 2*x
gen = myfunc()
while True:
try:
print(next(gen))
except StopIteration:
break
Code: Select all
@micropython.native
def myfunc():
for x in range(10):
yield 2*x
gen = myfunc()
while True:
try:
print(next(gen))
except StopIteration:
break