Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

list count python

# create a list
numbers = [2, 3, 5, 2, 11, 2, 7]

# check the count of 2
count = numbers.count(2)


print('Count of 2:', count)

# Output: Count of 2: 3
Source by www.programiz.com #
 
PREVIOUS NEXT
Tagged: #list #count #python
ADD COMMENT
Topic
Name
4+4 =