Python Program to Count the Occurrence of an Item in a List

 

Using count() method

freq = ['a', 1, 'a', 4, 3, 2, 'a'].count('a')
print(freq)

0 Comments