My array is bigger than yours…
We can easily find out how big an array is by using the len() function. However how many bytes does it take up in memory. That is a much more difficult problem.
A string uses one byte (well 2 if it is unicode, but we will assume ascii!) per character. So the string “hello” has a size of 5 bytes. For this example we will assume that a integer is 4 bytes.
a = ["Jamie", "George", "Fred", "Sue"] b = [4,76,24,87]
Using the above arrays AND using code work out the size, in bytes, that these two arrays take up.
Hint – You can use len(“hello”) to find out how many letters are in a string.
You need to log in or create an account to submit code!












