Question: There are three special things we can do with print in python. Printing will multiple arguments The first is giving a print function call multiple

There are three special things we can do with print in python.
Printing will multiple arguments
The first is giving a print function call multiple arguments:
print("Hello",'World', 1)
This will print Hello World 1. By default, your arguments are printed with a
single space between them.
sep
We can use the sep parameter to override the default behavior of printing
multiple arguments. Let learn by looking at a few examples:
print("Hello",'World', 1) # will print Hello World 1
print("Hello",'World', 1, sep='_') # will print Hello_World_1
print("Hello",'World', 1, sep='taco') # will print HellotacoWorldtaco1
print("Hello",'World', 1, sep='') # will print HelloWorld1
print("Hello",'World', 1, sep='') # the default behavior
end
We can change how print ends a line by using the end parameter.
for i in range(5):
print(i,end="") # will print 01234
print() #goes to a new line of output
You can combine sep and end in the same statement if needed.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!