【发布时间】:2021-04-21 05:31:03
【问题描述】:
我有一个列表列表
month_list = [['January', 'february', 'march'], ['april', 'may', 'june']]
这个字典的键 = 字符串,值 = int
month_ids = { 'January': 1,
'february': 2,
'march': 3,
'april': 4,
'may': 5,
'june': 6
}
我可以用字典中的整数替换列表中的字符串吗?
【问题讨论】:
标签: python string list dictionary integer