How to get the memory usage of a list in Python

1 Answer

0 votes
from sys import getsizeof
 
lst = [1, 2, 3, 4]
 
print(getsizeof(lst), 'bytes')  
 
  
  
  
'''
run:
  
88 bytes
 
'''

 



answered Jun 17, 2022 by avibootz

Related questions

...