Articles ā†’ Python ā†’ Print Function In Python

Print Function In Python






Purpose




  1. Data of any data type like integer, float, string, etc.
  2. Mathematical expressions
  3. Variables

Syntax


Print(data_to_be_printed)

Example




Picture showing the output of Print function in python



Printing Multiple Values Using The Print Function




Picture showing how multiple values is printed using the print function in python



End Parameter In The Print Function




tuple = ("Banana","Orange","Grapes","Strawberry")

x= 0

while x < 4:
    print(tuple[x], end='@')
    x = x + 1

print("\n")
x= 0

while x < 4:
    print(tuple[x], end='')
    x = x + 1


Picture showing the output of end attribute in print function



Posted By  -  Karan Gupta
 
Posted On  -  Tuesday, January 29, 2019
 
Updated On  -  Wednesday, September 22, 2021

Query/Feedback


Your Email Id
 
Subject
 
Query/FeedbackCharacters remaining 250