copy() method for dictionary
« All dictionary methods
copy(), takes no argument.
Returns : copied dictionary.
my_dict={'a':'Alex','b':'Ronald','c':'Ron'}
my_dict2=my_dict.copy()
print(my_dict2)
Output is here
{'a': 'Alex', 'b': 'Ronald', 'c': 'Ron'}
« All dictionary methods
This article is written by plus2net.com team.
plus2net.com