import re
a='ABCABADCSABBAUYIIYUyyike'
b=re.findall(r'.{1}',a) #单个字符长度查找,返回list对象
print(b)
c=set(b) #set去重
# list = [1, 2, 3, 4, 5,5,3,6,1] 去重
# b=[]
# for i in list:
# if i not in b:
# b.append(i)
# print(b)
print(c)
print('方法1')
for i in c:
x=0
for j in b:
if i==j:
x +=1
print('%s出现的次数%s'%(i,x))
print('方法二')
for i in c:
print('%s出现的次数%s'% (i,b.count(i)))