📜  python 集合和字典推导 - Python 代码示例

📅  最后修改于: 2022-03-11 14:47:18.253000             🧑  作者: Mango

代码示例1
simple_dict = {
    'a': 1,
    'b': 2
}
my_dict = {key: value**2 for key,value in simple_dict.items()}
print(my_dict)
#result = {'a': 1, 'b': 4}