counting instances in list code example
Example 1: python count occurrences of an item in a list
>>> [1, 2, 3, 4, 1, 4, 1].count(1)
3
Example 2: count the number of times a value appears in python
The count of i is: 2
The count of p is: 0
>>> [1, 2, 3, 4, 1, 4, 1].count(1)
3
The count of i is: 2
The count of p is: 0