Powered by Ajaxy
Digg StumbleUpon LinkedIn YouTube Flickr Facebook Twitter RSS Reset

Python: create a shallow copy of a dictionary

Python: create a shallow copy of a dictionary

# Define a dictionary
myDict = {'Font': 12, 'Style': 'Bold', 'Color': [255, 255, 255]}
# create a shallow copy
myDict2 = myDict.copy()
myDict2['Font'] = 14
# remove a value
print myDict2
print myDict

Users who found this page were searching for:

  • how to add file link in jpanal
  • python copy a dictionary
  • do-while loop even numbers
  • how to delete a shallow copy in python
  • python Qsettings "check if key exists"
  • python copy dictionary
  • program to calculate difference between two dates java
  • python making a copy of a dictionary
  • python shallow copy dictionary
  • shallow copy array python

No comments yet.

Leave a Comment