Home > Mobile >  How to access a key that is in a dictionary within another dictionary?
How to access a key that is in a dictionary within another dictionary?

Time:12-16

Here I have this code:

import emoji

txt = str(input('String: '))

for emoji in emoji.EMOJI_DATA:
    if emoji.EMOJI_DATA['en'] == txt:
        print('The emoji would be here')

With that code, I get this error: Keyerror['en'], because of course, there is no 'en' within EMOJI_DATA, so, how could I access what would be the emoji key here?

EMOJI_DATA = {
  '           
  • Related