0%
PythonJust enough Python, on real digits/15 min

Count the labels

The task

Graded on the printed count for two digits and a verdict line.

Finish count_label. It takes a digit and returns how many times that digit appears in digits.target. The loop at the bottom then prints the count for each digit 0 to 9, and a verdict: Balanced: yes if the largest count is less than 1.2 times the smallest, otherwise Balanced: no.

Sign in to start

Exercises need an account.

It is free. Log in or create one, and every attempt and pass is saved to your progress.