Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How many can a tuple or list contain in Python?

How many items can contain tuple or list in python? What will be if it is 10 000?

like image 924
Pol Avatar asked May 19 '26 07:05

Pol


1 Answers

import sys

print sys.maxsize
# prints some system-dependent number representing the maximum
# size most containers can hold.

Python sys module

I suspect on most platforms, sys.maxsize would return the same value as sys.maxint (which is guaranteed to be at least 2**31-1), but I doubt that's guaranteed.

like image 162
Brian S Avatar answered May 20 '26 20:05

Brian S



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!