Please explain me, is python uses more memory. | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Please explain me, is python uses more memory.

>>> a=12345 >>> sys.getsizeof(a) 28 >>> b=1 >>> sys.getsizeof(b) 28 >>> a="12345" >>> sys.getsizeof(a) 54 >>> b="1" >>> sys.getsizeof(b) 50 >>> b="12" >>> sys.getsizeof(b) 51

28th Apr 2017, 12:41 PM
pawan tripathi
pawan tripathi - avatar
4 Answers
+ 4
Python uses more memory than C++, notice the difference? Python (Interpreted), C++ (Compiled) and yes Interpreted languages have downsides
29th Apr 2017, 2:45 PM
Complex
Complex - avatar
+ 4
People use Pythob because of 3 things ease of learning, popularity and many school teaches it
29th Apr 2017, 11:55 PM
Complex
Complex - avatar
+ 1
If python3 uses more memory so why people is prefer? 🤔 Output shows a one int variable size id 28 byte 😱, and string variable size is 50 byte
29th Apr 2017, 3:28 PM
pawan tripathi
pawan tripathi - avatar
+ 1
(I read python treated all things in object form like a int type variable is a integer object type.) if this is true. So this is the reason of python uses more memory?
29th Apr 2017, 3:33 PM
pawan tripathi
pawan tripathi - avatar