Dictionary assignment : Dictionary Assignment « Dictionary « Python






Dictionary assignment

Dictionary assignment
 

x = {}
y = x
x['key'] = 'value'
print y

x = {}
print y


x = {}
y = x
y['key'] = 'value'
print y

print x.clear()
print y

           
         
  








Related examples in the same category

1.Change dictionary entryChange dictionary entry
2.enter all the data for dict3 at the same time
3.Add new entry to a dictionaryAdd new entry to a dictionary