1.
from collections import Counter
string = '1212ababABAB'
s = Counter(string)
print(s)
2.
string = '1212ababABAB'
s = {x: string.count(x) for x in set(string)} # 用的是字典推导式和str自带的str.count方法
print(s)
3.
string = '1212ababABAB'
def fun(s):
# 去除字符串中的空格
s = list(