小编use*_*492的帖子

Python:将空列表作为值添加到字典中

我想在name_input为空时追加一个空列表作为值,并且对于字典为grade_input为空,其字符为name_input.以下是代码段.但它似乎没有用.有什么建议?

if (name_input != '' and grade_input ==''):
        name_dic[name_input].append([])
Run Code Online (Sandbox Code Playgroud)

python dictionary list

1
推荐指数
1
解决办法
6990
查看次数

标签 统计

dictionary ×1

list ×1

python ×1