Skip to content

Instantly share code, notes, and snippets.

@MichaelCurrie
Last active December 14, 2022 10:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MichaelCurrie/46bb0c5b1704112a655d12f69dbaddc3 to your computer and use it in GitHub Desktop.
Save MichaelCurrie/46bb0c5b1704112a655d12f69dbaddc3 to your computer and use it in GitHub Desktop.
Shari Lewis teaches `yield`
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