[ How do I find out how many objects are in a list ]
basically what the title says. I want to be able to find out how many objects a list contains. Maybe my Google-fu is failing me or my terminology is wrong.
Return the length (the number of items) of an object. The argument may be a sequence (string, tuple or list) or a mapping (dictionary).
>>> l = [1, 2, 3] >>> len(l) 3
Check out the len built-in function:
a = ['1', '2', '3'] print len(a)
This wiil print: