current position:Home>Write a program in Python.

Write a program in Python.

2022-02-02 19:04:55 CSDN Q & A

Please write a program , The user enters a string of integers at one time , Integers are separated by a space , The program outputs the most repeated integer in this string




Refer to the answer 1:
from collections import Counter s = eval(input(">>>"))res = Counter(s).most_common(1)print(res[0][0])'''--result>>>3,3,3,2,1,6,7,7,7,4,3,7,7,77'''



Refer to the answer 2:

copyright notice
author[CSDN Q & A],Please bring the original link to reprint, thank you.
https://en.primo.wiki/2022/02/202202021904531505.html

Random recommended