Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

update a value in dict ython

d = {1: "one", 2: "three"}
d1 = {2: "two"}

# updates the value of key 2
d.update(d1)

#Output
{1: 'one', 2: 'two'}
Source by www.programiz.com #
 
PREVIOUS NEXT
Tagged: #update #dict #ython
ADD COMMENT
Topic
Name
4+2 =