Articles → Python → Print function in python

Print function in python






Purpose











Syntax


Print(data_to_be_printed)

Example




Picture showing the output of Print function in python

Click to Enlarge


Printing multiple values using print function




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

Click to Enlarge


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

Click to Enlarge


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