让用户随机输入一个字符串,找到这个字符串中出现次数最多的字符

str1 = input('请输入一个字符串:')

a = ''

count = 0

for i in str1:

if str1.count(i) > count:

count = str1.count(i)

a = i

print(a,count)