Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

Print Pretty in Python

import pprint

a = {'c': 2, 'b': 3, 'y': 5, 'x': 10}

pp = pprint.PrettyPrinter(sort_dicts=True)
pp.pprint(a)

# Output:
# {'b': 3, 'c': 2, 'x': 10, 'y': 5}
 
PREVIOUS NEXT
Tagged: #Print #Pretty #Python
ADD COMMENT
Topic
Name
4+2 =