You can use the sys.getsizeof() function to determine the size of an object in bytes.
While working with arrays, it is commonly necessary to count all its elements. This snippet will discover two helpful functions that will help you do that.