How to use len() in Python

The builtin len(obj) function is used to find the lengths of objects by calling their own length methods. For example, using len(obj) on a string calls the str.__len__() method to find the length of the string.

Solution for How to use len() in Python : You can use len() to find the length of an object Use len(obj) on obj to find its length. obj may be a sequence (e.g. a string, tuple, or list) or a mapping (e.g. a dictionary).

a_list = [1, 2, 3]


how-to-use-len-in-python