如何从值为列表的键中删除一个值?
- 论坛
- 如何从值为列表的键中删除一个值?
26 浏览
如何从值为列表的键中删除一个值?
这个问题已经有了答案:
这真的只是我的问题。我在网上只能找到如何删除键值对,而不是如何从一个键的值列表中删除特定值。
例如:一个键为 Emotions 的值为 [\'neutral\',\'happy\'],我只想删除 \'happy\'。dictionary[Emotions].remove(\'happy\')根本不起作用。
admin 更改状态以发布 2023年5月22日