Answers for "python pretty print object"

1

python pretty print

import pprint

student_dict = {'Name': 'Tusar', 'Class': 'XII', 
     'Address': {'FLAT ':1308, 'BLOCK ':'A', 'LANE ':2, 'CITY ': 'HYD'}}

print student_dict
print "n"
print "***With Pretty Print***"
print "-----------------------"
pprint.pprint(student_dict,width=-1)
Posted by: Guest on December-08-2020

Python Answers by Framework

Browse Popular Code Answers by Language