The mode is the value that shows up the most times. Unlike the mean and median, it's about how often a value appears, not how big it is.
Task: write mode(values) returning the most frequent value, rounded to 4 decimal places.
Ties need a rule, so here it is:
Also worth knowing:
values is never empty, and it arrives in no particular order.So the job is really two steps: count how often each value appears, then pick a winner from the ones that share the highest count.