小编Joe*_*rdi的帖子

Python-附加到字典中的列表

我一直在尝试使用不同的字典在字典中的列表末尾添加一个值。分配有点复杂,所以我将问题简化为这三行,但结果不断得到 None 。

finley = {'a':0, 'b':2, 'c':[41,51,61]}
crazy_sauce = {'d':3}
print finley['c'].append(crazy_sauce['d'])
Run Code Online (Sandbox Code Playgroud)

python dictionary

5
推荐指数
1
解决办法
2万
查看次数

标签 统计

dictionary ×1

python ×1