Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

python how to count all elements in a list

List = ["Elephant", "Snake", "Penguin"]

print(len(List))

#	With the 'len' function Python counts the amount of elements 
#	in a list (The length of the list).
#	In this case the output is '3' because there are 3 elements in the list. 
Source by www.pythonprogramming.in #
 
PREVIOUS NEXT
Tagged: #python #count #elements #list
ADD COMMENT
Topic
Name
7+2 =