count items with value in list python code example
Example 1: count number items in list python
mylist = ["abc", "def", "ghi", "jkl", "mno", "pqr"]
print(len(mylist))
# output 6
Example 2: count the number of times a value appears in python
The count of i is: 2
The count of p is: 0