Created
January 26, 2020 21:04
-
-
Save kunigami/d4cd16fc996f2d9f1d8e4c01911abd99 to your computer and use it in GitHub Desktop.
This file contains 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 naturals(): | |
n = 0 | |
while True: | |
yield n | |
n += 1 | |
for i in naturals(): | |
print(i) | |
if i > 10: | |
break |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment