I have a dictionary in the following format:
d = { 'x' : [1,2], 'y' : [1,3,4], 'z' : [1,1] }
And I am trying to append the values of 'd' to a list in the following format:
lst = [1,2,1,3,4,1,1]
Hence, 'lst' contains all the values of the dictionary 'd'.
My code :-
lst = [value for v in d.values()]
But this does not work.
Any suggestions as to how I can put these values in a list?
Thank you.