Intellipaat Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in Python by (47.6k points)

I am trying to find a simple way of getting a count of the number of elements in a list:

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

I want to know there are 3 elements in this list.

1 Answer

0 votes
by (106k points)

To count elements in the list you can use len() function below is the code:-

>>> someList=[] 

>>> print len(someList) 

0

To know more about this you can have a look at the following video tutorial:-

Related questions

0 votes
1 answer
+1 vote
2 answers
0 votes
1 answer

31k questions

32.8k answers

501 comments

693 users

Browse Categories

...