How to retrieve the value of 'Avengers'='Endgame'

Question:

ET={‘movies’:[{‘DC’:’Batman’,’Marvel’:[{‘Avengers’:’Endgame’,’Spiderman’:’NowayHome’}]}]}

Asked By: QWERTY

||

Answers:

If Entertainment is declared as

Entertainment = {'game':'football'}, {'other':[{'movies':'NowayHome'},{'songs':'latest'}]}

The answer will be

Entertainment[1]['other'][0]['movies']
Answered By: Pto

self explained

ET = {
    'movies': [{
        'DC': 'Batman',
        'Marvel': [{
            'Avengers': 'Endgame',
            'Spiderman': 'NowayHome'
        }]
    }]
}

'''
ET['movies'] => select key
ET['movies'][0] => select first list
ET['movies'][0]['Marvel'] => select key
.....
'''

Avengers = ET['movies'][0]['Marvel'][0]['Avengers']
print(Avengers) # Endgame
Answered By: uingtea
Categories: questions Tags: , ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.