1thislist = (1, 3, 7, 8, 7, 5, 4, 6, 8, 5)
2
3x = thislist.count(5)
4
5print(x)
1student_grades = [9.1, 8.8, 10.0, 7.7, 6.8, 8.0, 10.0, 8.1, 10.0, 9.9]
2
3samebnumber = student_grades.count(10.0)
4
5print(samebnumber)
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)
1mylist = ["abc", "def", "ghi", "jkl", "mno", "pqr"]
2
3print(len(mylist))
4
5# output 6
1from collections import Counterli = ['blue', 'pink', 'green', 'green', 'yellow', 'pink', 'orange']Counter(li)#=> Counter({'blue': 1, 'pink': 2, 'green': 2, 'yellow': 1, 'orange': 1})