+ 1
I get the code given down below on sololearn challenge, can somebody tell me why here the dictionary length is coming out 4?
d = {'s':'o', 'l':'o', 'l':'e', 'a':'r', 'n':'!'} print(len(d)) I also tried it with some other examples but only in this its happening, in others the length is coming 5, and here also it should be 5 then what's the problem...
2 Antworten
+ 3
If key is already exist in dictionary, then the value is just replaces old value. Not allows dublicate key in dictionary...
So only 4 keys with 4 values...
0
Jayakrishna🇮🇳 got it...
I didn't noticed that earlier... 😅