This function produces a printable string representation of a dictionary
str(dict)
Here is the detail of parameters:
dict: This is the dictionary.
#!/usr/bin/python dict = {'Name': 'Zara', 'Age': 7}; print "Equivalent String : %s" % str (dict)
This produces following result:
Equivalent String : {'Age': 7, 'Name': 'Zara'}
Advertisement