Finding the Length of a String or List in Python


Use the len() function to find the length of a string, list, or other iterable.

Source Code

print(len("hello"))
print(len([1, 2, 3, 4, 5]))
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments