How to pretty print a list in Python

Pretty printing a list prints it hierarchically and displays the contents in an indented tree-like formation.

Solution for How to pretty print a list in Python : You can use pprint.pprint() to print a list hierarchically Call pprint.pprint(object, indent=1) with object as a list to print it hierachically with indents equal to indent.


how-to-pretty-print-a-list-in-python