Lists and collections · Python exercise
Count how many times a target value appears in a list.
The first line contains a target integer. The second line contains space-separated integers. Print how many times the target appears.
Example 1
Input
2 1 2 2 3
Output
2
Example 2
Input
5 1 2 3
Output
0
How testing works
Your code runs once per test case with that case's standard input. Output is compared after normalising trailing spaces and blank lines at the end. Use input() without a prompt when the exercise expects clean output.
Loading editor…
Press Run tests to execute your code against every input case. Python runs in a Web Worker in your browser.