Using the len() Function in Python – Real Python
realpython.com › len-python-functionOct 20, 2021 · The function len () is one of Python’s built-in functions. It returns the length of an object. For example, it can return the number of items in a list. You can use the function with many different data types. However, not all data types are valid arguments for len (). You can start by looking at the help for this function: >>>
Python len() - Programiz
www.programiz.com › python-programming › methodsprint (testList, 'length is', len (testList)) testList = [1, 2, 3] print(testList, 'length is', len (testList)) testTuple = (1, 2, 3) print (testTuple, 'length is', len (testTuple)) testRange = range (1, 10) print('Length of', testRange, 'is', len (testRange)) Output.