-
-
Save kshirsagarsiddharth/3029f0b15528c8eaf7d2f1610543800f to your computer and use it in GitHub Desktop.
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 myfunc(): | |
| x = "" | |
| while True: | |
| print("Yielding {} and waiting".format(x)) | |
| x = yield x | |
| if x is None: | |
| break | |
| print("Got {}. Doubling".format(x)) | |
| x = x * 2 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment