python获取列表中出现最频繁的汉字字符串
1、效果
strings = ["北京", "上海", "广州", "深圳", "成都", "广州", "成都"]
输出:
成都
2、流程
1、导入locale模块
2、设置locale为中国大陆,用于获取汉字的拼音首字母
3、获取列表中出现最频繁的字符串
3、代码
# -*- coding: utf-8 -*-
"""
@contact: 微信 1257309054
@file: test.py
@time: 2024/7/23 19:36
@author: LDC
"""
# 导入locale模块
import locale
def get_max_zh