Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

how to append dict to dict in python

test={'item1': 1,
       'item2': 2,
      }
default_data = test

default_data.update({'item3': 3})
# or
default_data['item3'] = 3
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #append #dict #dict #python
ADD COMMENT
Topic
Name
1+4 =