I am confused in get method is working in dictionary | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

I am confused in get method is working in dictionary

https://code.sololearn.com/cs4GhcD0Quj9/?ref=app

21st May 2021, 2:25 PM
Akash Prasad
Akash Prasad - avatar
3 Answers
+ 5
dicTioNary.get(x,y) x ==> key y ==> value to be returned if x key doesn't exist in dictionary .
21st May 2021, 2:44 PM
TOLUENE
TOLUENE - avatar
+ 4
Akash Prasad you declared first 1:"Apple" True:False Here True is considered as numeric value 1 . so your previous 1:"Apple" gets override by 1:False
21st May 2021, 2:51 PM
TOLUENE
TOLUENE - avatar
0
SAYED🇧🇩🇵🇸 thanks your help but when i print dictionary again the key and their values get randomised i don't why
21st May 2021, 2:48 PM
Akash Prasad
Akash Prasad - avatar