The print() function is the simplest way to produce an output in python while using it in data science or in general. In it, we can pass zero or more expressions separated by commas. This function converts the passed expression into a string and then writes on the screen.
Code 1: Using print() function in Python 2.x
# Python 2.x program showing
#how to print data on
# a screen
#One object is passed
print “PSTAnalytics”
#Four objects are pass
print “PST”, “Analytics”
l = [1, 2, 3, 4, 5]
# printing a list
print l
Output:
PSTAnalytics
PST Analytics
[1,2,3,4,5]
Code 2: Using print() function in Python 3.x
#Program showing
#how to print data on
# a screen in python for data science
#One object is passed
print(“PSTAnalytics”)
x = 4
# Two objects are passed
print(“x =”, x)
# code for disabling the softspace feature
print(‘P’, ‘S’, ‘T’, sep =”)
# using end argument
print(“Python”, end = ‘@’)
print(“PSTAnalytics”)
Output:
PSTAnalytics
X = 4
PST
To learn more about it python, you can check this and this.