Copyright © tutorialspoint.com

Python dictionary str() Function

previous next


Description:

This function produces a printable string representation of a dictionary

Syntax:

str(dict)

Parameters:

Here is the detail of parameters:

Example:

#!/usr/bin/python

dict = {'Name': 'Zara', 'Age': 7};
print "Equivalent String : %s" % str (dict)

This produces following result:

Equivalent String : {'Age': 7, 'Name': 'Zara'}

previous next

Copyright © tutorialspoint.com