Web | This Site

Python Basics
Python Advanced
Python Useful References
Python Useful Resources
Selected Reading
© 2011 TutorialsPoint.COM

| Home |  | References |  | Discussion Forums |  | About TP

# Python dictionary copy() Method

## Description:

This class method returns a shallow copy of the dictionary.

## Syntax:

    dict.copy()

## Example:

    #!/usr/bin/python

    dict1 = {'Name': 'Zara', 'Age': 7};

    dict2 = dict1.copy()
    print "New Dictinary : %s" %  str(dict2)

This produces following result:

    New Dictinary : {'Age': 7, 'Name': 'Zara'}

Advertisement

Online Image Processing

Indian Baby Names