Difference Between end and sep in Python

Parameter Function Default Value  Usage Example
 
end  Specifies what should be printed at the end of the output.  ‘\n’ (newline character)  print(“Hello”, end=’!’)<br>Prints “Hello!” with an exclamation mark at the end.
 

sep

Specifies what separator character should be printed between multiple values. 

Space character (‘ ‘) 

print(“apple”, “banana”, “cherry”, sep=’-‘)<br>Prints “apple-banana-cherry” with hyphens between each value.

Difference between end and sep in Python

In this article we will discuss the difference between The end and sep are two parameters in Python’s built-in print() function that will help to control how the output is formatted.

Similar Reads

end in Python

The end is a parameter in Python’s built-in print() function that controls what character(s) are printed at the end of the printed text....

sep in Python

...

Difference Between end and sep in Python

the sep parameter is used to specify the separator between the values that are passed to the print() function....

Conclusion

...