I have converted the nested loop into dictionary. Here is the nested list.
score = [['hamza', 30], ['ali', 20], ['abdul',50]]
I have converted this into dict with this code.
my_dict = { k[0]: k[1:] for k in score}
Here is the output.
{'hamza': [30], 'ali': [20], 'abdul': [50]}
Why in the values are inside the list.
Is there anyway to get the values without list.