size of in python code example
Example 1: size of variable python
import sys
sys.getsizeof(object[, default])
# returns size of object in bytes
Example 2: list length in python
list1 = [1,2,3]
print(len(list))
import sys
sys.getsizeof(object[, default])
# returns size of object in bytes
list1 = [1,2,3]
print(len(list))