how to count things in a list python

Solutions on MaxInterview for how to count things in a list python by the best coders in the world

showing results for - "how to count things in a list python"
Yannic
10 Nov 2020
1list.count(element)
2
3list1 = ['red', 'green', 'blue', 'orange', 'green', 'gray', 'green']
4color_count = list1.count('green')
5print('The count of color: green is ', color_count)