Python program to Group Dictionaries into Lists

dict = {'one':1, 'two':2, 'three':3}
x = [[y,z]for y, z in dict.items()]
print(x)

 

 

 

Output:

[['one', 1], ['two', 2], ['three', 3]]

 

Subscribe For Daily Updates

100+ Python Pattern Examplespython pattern examples - star patterns, number patterns