def print_most_numbers_occurrences(numbers_str):
number_list = numbers_str.split()
for i in number_list:
i=max(number_list,key=number_list.count)
print(i)
def test_print_most_numbers_occurrences():
print_most_numbers_occurrences('2 3 40 1 5 4 3 3 9 9')
print_most_numbers_occurrences('9 30 3 9 3 1 4')
print_most_numbers_occurrences('19 30 13 4 9 3 1 4')
def main():
test_print_most_numbers_occurrences()
main()
output:
3
9
4
I want to get all most repeating numbers for '9 30 3 9 3 1 4'
: 9 and 3 appear twice, so both occurrences should be reported not only 9
output looks like this:
3
9
3
4