pprint is a beneficial built-in module in Python for Data Science. The pprint module helps us to “pretty print” arbitrary data structures in Python in a well formatted and readable way.
The below example will make things clear.
The code given above is for getting geocode information of some place using Google Maps API in JSON format.
The output is not properly indented, and it affects the readability for nested data structures. Now we will look at an example.
In the above example, we imported the pprint function of pprint module. We use the pprint() function here rather than the print function.