Skip to content

Instantly share code, notes, and snippets.

@potocpav
Last active January 30, 2020 08:12
Show Gist options
  • Save potocpav/510238f263c5f5c32a24cf2b90442324 to your computer and use it in GitHub Desktop.
Save potocpav/510238f263c5f5c32a24cf2b90442324 to your computer and use it in GitHub Desktop.
greetings = [(lambda: f"Hello, {i}!") for i in range(4)]
# What do these output?
print(greetings[0]())
print(greetings[1]())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment