from collections import Counter
ybb1=['中国 美国','美国 俄罗斯','中国']
ybb2=[]
for i in ybb1:
list = i.split()
for x in list:
ybb2.append(x)
print(Counter(ybb2))
使用for循环每个字符,例如:
country = ['中国', '美国']
count = 0
for temp in country:
for _ in temp:
count += 1
print(count)