1 from collections import Counter 2 def mn(m,n): 3 4 q1='gbgkkdehh1' 5 a = Counter(q1) 6 print(a) 7 b = dict(a) 8 print(b) 9 s = [] 10 for k,j in b.items(): 11 if j==n: 12 s.append(k) 13 c = s[m-1]
14 print(s)
15 return c 15 if __name__ == '__main__': 16 print(mn(2,1))
输出结果: