Print Function In Python 3.8

The print function in the programming language prints or output the specified message which developer put in the code, it display on the screen, or other stranded output devices.

The message may be string, number, or any other object. The object will be converted into string before display on the screen. When you write user input field in print function it is highly recommended you should declare a data type first if you are writing integer, double or float  For example


print(object (s), sep = saperator, end = end, file = file, flush = flush)

Print() Parameters:




Any object, and as many as you like, will be converted to string before printing.

sep = 'separtor'

optional. Specify how toseparate the objecgts, if there is more than one.

end = 'end'

Optional. Specify what to print at the end. Default is '\n'


Optional. An object with a write method. Default is sys.stdout


Optional. A Boolean, specifying if the output is flushed (True) or buffered (False). Default value is False.


sep, end, file, and flush are keyword arguments. If you want to use sep argument, you have to use:

print (object, sep = ‘separator’)

print (object, ‘separator’) =====> Wrong argument

Example Of Print Function In Python:

>>>print (“Hello Word”)

>>Hello Word

>>>print (25)


>>>print (20+ 5)


>>>print(“12*5 =:”, 12 * 5)

12*5 = 60

>>print (“GSS “, “TECHNOLOGY”, sep=”=========”)

GSS============= TECHNOLOGY

Access The Value of A Variable In A Print () Function:

>>>x = “Hello”

>>>print (x)


>>>x = “2,4,6,8,10”

>>>print (x)


>>> print (“Hello %s” % name)
>>> name = “Sadaqat”
>>> print (name)
>>> age = 16
>>> print (“Hello %s! Are your %d years old” % (name, age))
Hello Sadaqat! Are your 16 years old

print function in python

Decimal Value Limit In Print Function

 Print function in python,  when you write a decimal value it comes 6 digit after decimal. For example print (“marks =%f” % 90.5) the result will be 90.500000, so now we want decrease the limit after decimal. How you do it just follow this example.

>> print(“Marks = %f” % 90.5)
Marks = 90.500000

>> print(“Marks = %.2f” % 90.5)
Marks = 90.50

print function in python

This Post Has 5 Comments

  1. download

    I got what you intend,saved to fav, very decent web site. Henrieta Codie Gideon

    1. gsstechnology

      Thank You for interested in my site.

Comments are closed.