Created
September 2, 2018 06:46
-
-
Save magusafr/aed26790416b03ad1962d867ca44615a to your computer and use it in GitHub Desktop.
mode first for the most occur of number
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
data=[1,2,5,10,-20,5,5,7, 7, 7, 7] | |
mode = [ data.count(data[i]) for i in range(len(data))] | |
print(data[mode.index(max(mode))]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment