The mode

Report a typo

In statistics, the mode is the most common value in the data. Imagine you are a statistician working with some data. Write a program that finds its mode.

The input format:

The data values separated by whitespace. The data can be of any type: numbers, words, etc. It is guaranteed that the data will have only one mode!

The output format:

The mode of the data.

Sample Input 1:

1 7 3 3 8 9 10 5 5 5 4 1 5 6

Sample Output 1:

5

Sample Input 2:

red green yellow red orange blue purple

Sample Output 2:

red
Write a program in Python 3





___

Create a free account to access the full topic