1# Basic syntax:
2sum(1 for item in your_list if item == "some_condition")
3# This counts the items in your_list for which item == "some_condition"
4# is true. Of course, this can be changed to any conditional statement
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)