+ 1

Why python does not have a limit in the size of an integer where as C,C++ etc have a limit size for int?????

18th May 2019, 11:26 AM
Ritika Joshi
Ritika Joshi - avatar
2 Answers
+ 1
Python has a limit. But it automatically changes the variable type once it gets too large During excecution it could be like "Oh NO! Variable big_num's getting to big for the Int datatype. Im changing it to a long"
18th May 2019, 12:50 PM
Trigger
Trigger - avatar
0
Mmh I think python has a limit, though I'm not sure but the difference is that c++,c and others are lower level languages, meaning you have to handle a lot more things. When it comes to integer size, python can automatically change the number of bits allocated to store a variable, while languages like Java, c, c++ have a fixed amount (32 bits). That's why they also have types like byte, short, long, ...
18th May 2019, 11:51 AM
ThewyShift
ThewyShift - avatar