【发布时间】:2022-08-02 16:39:14
【问题描述】:
我创建了一个标志颜色字典:
flag_colours={\'uk\': [\'blue\',\'white\', \'red\'],
\'france\': [\'blue\', \'white\', \'red\'],
\'italy\': [\'green\', \'white\', \'red\'],
\'switzerland\': [\'red\', \'white\']}
我想提取国旗中有两种以上颜色的国家,但我不确定如何添加它:我目前有 [x for x in flag_colours if \'\' in x] 用于提取但不确定添加什么
标签: python dictionary extract