Last active
April 7, 2021 13:13
-
-
Save carloocchiena/1216752387f0f26d1999dfd986d94ffe to your computer and use it in GitHub Desktop.
Python return vs yield >> function with multiple outputs
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 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