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:
printHello'World',
This will print Hello World 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:
printHello'World', # will print Hello World
printHello'World', sep # will print HelloWorld
printHello'World', sep'taco' # will print HellotacoWorldtaco
printHello'World', sep # will print HelloWorld
printHello'World', sep # the default behavior
end
We can change how print ends a line by using the end parameter.
for i in range:
printiend # will print
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
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
