+ 1
How to print only values in a dictionary? Eg: d={'US':{'CA':44 },'IND':{'KA':91} } Output should be only 44 and 92....?
How to print only values in a dictionary? Eg: d={'US':{'CA':44 },'IND':{'KA':91} } Output should be only 44 and 92....?
4 Answers
+ 3
You could use key, value twice or use the get method.
I worked it out in the code below.
https://code.sololearn.com/c91BS9fz99r9/?ref=app
+ 2
Take a look at the second solution. It doesn't require the element names.
0
What if I don't know the elements names in the dictionary....??? I want it to be more generic way...
0
Thank you so much davy hermans