How Many Bytes Does a Complex Number Have in Python?
The short answer is 80 bytes. Here’s the longer answer: In Python, you can determine the size of any object x by using the function sys.getsizeof(x). The complex number consists of two parts: the real and the imaginary part. On my notebook, a complex number is represented by 32 bytes: Note that the sys.getsizeof() method … Read more