Freq Digits
Given an integer number, find the most frequent digit in it.
-
how to count things efficiently?
-
keep calm and code in Python!
Let use the statistics that comes with python stand library
Statistic Module
This module provides functions for calculating mathematical statistics of numeric (Real-valued) data.
This module statistics offers a Single mode (most common value) of discrete or nominal data. The values or method to find this is to convert the vaules into a string and then back again once the frequent digit is found
Trying out a value
Next we want to test a value
Finally
we can run the function with some additional values and input
1
3
7
1
Read other posts