s = "word世界peace和平" # 统计并输出中文字符出现的个数
count = 0
for c in s:
if u'\u4e00' <= c <= u'\u9fa5':
count += 1
print(count)
欢迎关注博主网站:https://www.aimath.top/
s = "word世界peace和平" # 统计并输出中文字符出现的个数
count = 0
for c in s:
if u'\u4e00' <= c <= u'\u9fa5':
count += 1
print(count)
欢迎关注博主网站:https://www.aimath.top/