-2

I have a string:

my_str =  '{"country":{"AE":"United Arab Emirates","AL":"Albania","AM":"Armenia","AR":"Argentina","AT":"Austria","AU":"Australia","AW":"Aruba"}}'

Is there an easy way to convert it into dictionary? I'd like to use something like dict(my_str) but it doesn't exist.

Easy way.

Mario Honse
  • 289
  • 1
  • 3
  • 10

1 Answers1

3

Try this, this is one way only from many ways

json.loads(my_str)
itzMEonTV
  • 19,851
  • 4
  • 39
  • 49