how to determine the size of a list in python excluding memory consumption by actual data code example Example: what takes more memory string or list python import sys sys.getsizeof(5) 24