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
{filelink=15992}

# 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
myDict2['Color'].remove(0)
print myDict2
print myDict

Users who found this page were searching for:

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

No comments yet.

Leave a Comment