Yashotantra Academy
AI · Blockchain · Cloud · Data
Dark mode active
Learn
Tracks
ABCD
Certification
More
▾
Dark mode active
Learn
Tracks
ABCD
Certification
Study
Theory
Code Lab
Build
Solidity IDE
Staking Sandbox
Simulation
Reference
Wallets
Gas Fees
Explorers
← Code Lab
Python
0/50 solved · 0%
All lessons
lesson
code
Functions · medium
21. Generators and yield
Produce values lazily.
Write a generator function `block_numbers(start, count)` that `yield`s `count` sequential integers beginning at `start`.
Required in your answer:
yield
Reveal solution
Run & check
Reset
Runs via Pyodide
def block_numbers(start, count): # TODO: use yield in a loop pass
Output appears here.
← 20. Dict comprehensions
22. Decorators →