Tutorials Point


  Python Basics
  Python Advanced
  Python Useful References
  Python Useful Resources
  Selected Reading

© 2011 TutorialsPoint.COM


  Home     References     Discussion Forums     About TP  

Python dictionary str() Function


previous next AddThis Social Bookmark Button


Description:

This function produces a printable string representation of a dictionary

Syntax:

str(dict)

Parameters:

Here is the detail of parameters:

  • dict: This is the dictionary.

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 Printer Friendly



  

Advertisement

Online Image Processing

Indian Baby Names