Main Tutorials

Python – Count the number of items in a list

In Python, we can use len() to count the number of items in a List


list = ["a", "b", "c"]

print(len(list))

Output


3

References

  1. Pyhton docs – len()

About Author

author image
Founder of Mkyong.com, love Java and open source stuff. Follow him on Twitter. If you like my tutorials, consider make a donation to these charities.

Comments

Subscribe
Notify of
0 Comments
Inline Feedbacks
View all comments