How Many Were Repeats?

Python for AIEasy+10 XP+10

How Many Were Repeats?

A shop writes down every shoe size it sells. Some sizes get written more than once.

Task: write repeat_count(values). Return how many entries in the list were repeats — that is, how many entries you could cross out and still have every different size written down once.

An empty list has 0 repeats.

Examples

values = [7, 9, 7, 3, 5, 9]
returns 2
values = [1, 2, 3]
returns 0

Hints

Solve it to unlock the solution

Once your code passes every test, a reference solution shows up here so you can compare it with yours.

solution.py
CtrlEnterto run