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()

mkyong

Founder of Mkyong.com, passionate Java and open-source technologies. If you enjoy my tutorials, consider making a donation to these charities.

0 Comments
Most Voted
Newest Oldest
Inline Feedbacks
View all comments