Skip to content

Instantly share code, notes, and snippets.

@carloocchiena
Last active April 7, 2021 13:13
Show Gist options
  • Save carloocchiena/1216752387f0f26d1999dfd986d94ffe to your computer and use it in GitHub Desktop.
Save carloocchiena/1216752387f0f26d1999dfd986d94ffe to your computer and use it in GitHub Desktop.
Python return vs yield >> function with multiple outputs
def my_func:
for num in range(50):
yield num ** num
for values in my_func():
print (values)
all_values = list(my_func())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment