📜  Transformer un dictionnaire en liste python 代码示例

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

代码示例1
# A list of the keys of dictionary
list_keys = [ k for k in dict ]
 
# or a list of the values
list_values = [ v for v in dict.values() ]
 
# or just a list of the list of key value pairs
list_key_value = [ [k,v] for k, v in dict.items() ]