dictionary2 = {'Key1': {'Key2': 'HSR'}, 'Key2':{'Key2' : 'HsR'},'Key3':'HSr'} | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

dictionary2 = {'Key1': {'Key2': 'HSR'}, 'Key2':{'Key2' : 'HsR'},'Key3':'HSr'}

Grab 'HSR' using keys and indexing.

13th Apr 2020, 12:38 PM
Sukanya Bag
Sukanya Bag - avatar
3 Answers
+ 1
dictionary2['Key1']['Key2']
13th Apr 2020, 12:56 PM
Mo Hani
Mo Hani - avatar
+ 1
The 1st one will be Key1
13th Apr 2020, 1:53 PM
Sukanya Bag
Sukanya Bag - avatar
+ 1
Sometimes it is faster to try than to ask (try this code on the playground): dictionary2 = {'Key1': {'Key2': 'HSR'}, 'Key2':{'Key2' : 'HsR'},'Key3':'HSr'} print(dictionary2['Key1']['Key2'])
13th Apr 2020, 2:26 PM
Paul
Paul - avatar