1. Python

pprint Python Module

pprint function from pprint Python Module can be used to print stuff to console, like print function. But for printing out non pythonic data types pprint just makes output a little bit readable.

Python Code Showing use of pprint

# Python Code showing use of pprint Module

# Importing pprint module
import pprint

# Some weird data
data = (
	"This is ComputerScienceHub.io", ["Computer Science", "Programming", "Machine Learning"],
	("We have a lot of computer science experts")
	)

# Prints out weird data beautifully
pprint.pprint(data)

Output of Above Code

('This is ComputerScienceHub.io',
 ['Computer Science', 'Programming', 'Machine Learning'],
 'We have a lot of computer science experts')

pprint function just makes stuff more readable, specifically this can be used to examine data returned by some API. As usually, most of APIs return data in some weird form.
I hope that you found this article useful, similar to this I’ve put together a number of other articles about Python Programming Language. You can check those out here => Python Programming Language Computer Science Hub.

Comments to: pprint Python Module

Your email address will not be published.

Ads