📜  python 将函数应用于字典值 - Python 代码示例

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

代码示例1
# credit to Stack Overflow user in source link
# f is a Python - defined function

d2 = {k: f(v) for k, v in d1.items()}