Data Analysis with Python - Numpy Introduction B

Tell us what’s happening:

Answer in the video is wrong, if I run
import sys

integer_value = 5
size = sys.getsizeof(integer_value)
print(f"The memory consumption of the integer 5 is {size} bytes.")

I’ll get the consumption of 28 bytes.

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/125.0.0.0 Safari/537.36

Challenge Information:

Data Analysis with Python - Numpy Introduction B

1 Like

Hi, welcome to the forum :wave:

You seem to be correct to me. There was even a previously unanswered post about this:
https://forum.freecodecamp.org/t/data-analysis-with-python-course/604355

__sizeof__() also returns the same result

import sys

integer_value = 5
size = sys.getsizeof(integer_value)
print(integer_value.__sizeof__())
print(f"The memory consumption of the integer 5 is {size} bytes.")

>>> 28
>>> The memory consumption of the integer 5 is 28 bytes.

He isn’t actually precise in the video he says “around 20 bytes”

Do you want to open an issue for this on github?
https://github.com/freeCodeCamp/freeCodeCamp/issues

I also found this, I created an issue at Data Analysis with Python - Numpy Introduction B · Issue #55999 · freeCodeCamp/freeCodeCamp · GitHub

1 Like