[python] Creating an Instance of a Class with a variable in Python

This is a very strange question to ask, specifically of python, so being more specific will definitely help me answer it. As is, I'll try to take a stab at it.

I'm going to assume what you want to do is create a new instance of a datastructure and give it a variable. For this example I'll use the dictionary data structure and the variable mydictionary.

mydictionary = dict()

This will create a new instance of the dictionary data structure and place it in the variable named mydictionary. Alternatively the dictionary constructor can also take arguments:

mydictionary = dict([('sape', 4139), ('guido', 4127), ('jack', 4098)])

Finally, python will attempt to figure out what data structure I mean from the data I give it. IE

mydictionary = {'jack': 4098, 'sape': 4139}

These examples were taken from Here