how .....?? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

how .....??

https://code.sololearn.com/cebXGf11Gq58/?ref=app how the print(dict) at last outputs all the letters while it should have print only the final result from the for..loop..

20th May 2021, 5:00 PM
kushal
1 Answer
+ 4
kushal It's a dictionary and in for we are storing count of duplicate character. So when we print dictionary, it print all values with key value dictionary is a collection that's why output is coming like that.
20th May 2021, 5:19 PM
A͢J
A͢J - avatar