How do I get the length of a list? - Stack Overflow
https://stackoverflow.com/questions/1712227/how-do-i-get-the-number-of-elements-in-a-list-length-of-a-list-in-python
WebNov 11, 2009 · You can use the len() function to find the length of an iterable in python. my_list = [1, 2, 3, 4, 5] print(len(my_list)) # OUTPUT: 5 The len() function also works with strings: my_string = "hello" print(len(my_string)) # OUTPUT: 5 So to conclude, len() works with any sequence or collection (or any sized object that defines __len__).
DA: 14 PA: 13 MOZ Rank: 88 Up or Down: Up