0

This is my python code. I am completely new to python and would like to clarify my doubt. So kindly help me out with this. I am trying to print a sorted list of Keys of a dictionary but I am not getting my desired output.


D = { 'gible':'garchomp' , 'chimchar':'Infernape' , 'charmader':'charizard' }

print("Printing the keys\n\n")

for key in D.keys():

     print (sorted(key))

Please find the Image of the Output for the above Code Here

The output is not what I am expecting. I want my output to be :

gible,chimchar,charmander. 

0 Answers0