Last active
December 14, 2022 10:19
-
-
Save MichaelCurrie/46bb0c5b1704112a655d12f69dbaddc3 to your computer and use it in GitHub Desktop.
Shari Lewis teaches `yield`
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
def the_song_lyrics(): | |
while True: | |
yield "This is the song that doesn't end" | |
yield "Yes it goes on and on my friends" | |
yield "Some people started singing it, not knowing what it was" | |
yield "And they'll continue singing it forever, just because" | |
for lyric in the_song_lyrics(): | |
print(lyric) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment