Created
June 10, 2021 01:53
-
-
Save rajmayank/428eca4b0af537442d342a77729db22c to your computer and use it in GitHub Desktop.
Python-Generators-API-Introduction-II
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
import sys | |
secretV1 = doSecretStuffVersion1(5) | |
secretV2 = doSecretStuffVersion2(5) | |
print(secretV1). # 12593025435840... | |
print(type(secretV1)) # <class 'int'> | |
print(secretV2) # <generator object doSecretStuffVersion2 at 0x10ca5ab30> | |
print(type(secretV2)) # <class 'generator'> | |
print(sys.getsizeof(secretV1)) # 9312 | |
print(sys.getsizeof(secretV2)) # 112 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment