So I have list like a = [1, 2, 3, 4, 5, 1] and in that list "1" is the element which appeared most times, is there a function which can detect that "1" has appeared most times? Is it even possible to detect? I need to generate random list and detect which element appeared most times in it, that is the main problem.
Asked
Active
Viewed 52 times
0
-
`max(a, key=a.count)` – Delgan Dec 20 '16 at 23:08
-
2"Is it even possible", lol. No, that's mathematically impossible. Counting numbers is very hard for computers. – Blorgbeard Dec 20 '16 at 23:11