Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

nesting a dictionary in a list python

#Nesting a Dictionary Inside a list
travel_log = [
    {
      "country": "France", 
      "cities_visited" : ["Paris", "Lille", "Dijon"], 
      "total_visits" : 12
    },
    {"country": "Germany" ,
     "cities_visited" :["Berlin", "Hamburg", "Stuttgart"],
     "total_visits" : 12
    },
]
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #nesting #dictionary #list #python
ADD COMMENT
Topic
Name
5+6 =