number of elements in list in python

Solutions on MaxInterview for number of elements in list in python by the best coders in the world

showing results for - "number of elements in list in python"
Giada
20 Jun 2017
1list1 = [2,3,4,3,10,3,5,6,3]
2elm_count = list1.count(3)
3print('The count of element: 3 is ', elm_count)
Lorenzo
30 Jun 2016
1>>> mylist = [1,2,3] #list
2>>> len(mylist)
33
4>>> word = 'hello' # string 
5>>> len(word)
65
7>>> vals = {'a':1,'b':2} #dictionary
8>>> len(vals)
92
10>>> tup = (4,5,6) # tuple 
11>>> len(tup)
123
Brodie
31 Jul 2016
1# List of strings
2listOfElems = ['Hello', 'Ok', 'is', 'Ok', 'test', 'this', 'is', 'a', 'test']
3len(s)
similar questions
queries leading to this page
number of elements in list in python