Created
May 26, 2025 09:26
-
-
Save moreati/c255aceee080c2f504efa979c2a6459d to your computer and use it in GitHub Desktop.
Python's "yield from" cna be used with a sequence
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
TODAY = [ | |
'Haircut', | |
'Buy milk', | |
] | |
TONIGHT = [ | |
'Try to take over the world!', | |
] | |
def todo_items(): | |
yield from TODAY | |
yield from TONIGHT | |
if __name__ == '__main__': | |
for item in todo_items(): | |
print(f'- [] {item}') |
Author
moreati
commented
May 26, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment