python data structures in dictionary each key is separated from its value by colon (:)the items are separated by commasand the whole thing is enclosed in curly braces an empty dictionary without any items is written with just two curly braceslike this{keys are unique within dictionary while values may not be the values of dictionary can be of any typebut the keys must be of an immutable data typesuch as stringsnumbersor tuples accessing values in dictionary to access dictionary elementsyou can use the familiar square brackets along with the key to obtain its value simple example is as follows#!/usr/bin/python dict {'name''zara''age' 'class''first'print "dict['name']"dict['name'print "dict['age']"dict['age'when the above code is executedit produces the following resultdict['name']dict['age']zara if we attempt to access data item with keywhich is not part of the dictionarywe get an error as follows#!/usr/bin/python dict {'name''zara''age' 'class''first'print "dict['alice']"dict['alice'when the above code is executedit produces the following resultdict['alice']traceback (most recent call last)file "test py"line in print "dict['alice']"dict['alice']keyerror'alice