All problems
EasyLists
Count occurrences
Count how many times the value 3 appears in a list.
- #count
Sample input
[1, 3, 2, 3, 3, 4, 1]
Sample output
3
list-count-occurrences.py
Output
Press "Run code" to execute.
Loading…
Count how many times the value 3 appears in a list.
[1, 3, 2, 3, 3, 4, 1]
3
Press "Run code" to execute.