![]() |
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. end in PythonThe 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.
Syntax :
Example :Python
Output : 1 2 3 4 5 sep in Pythonthe sep parameter is used to specify the separator between the values that are passed to the print() function.
Syntax :
Example :Python
Output : apple-banana-cherry Here’s an example that represents both the sep and end parameters in one lineExample :Python3
Output: Apples, Orange, Mango are fruits! Difference Between end and sep in Python
ConclusionIn Python, the sep parameter controls how items are separated within single print() statement in while the end parameter determines what is printed at the end of statement. These parameters provide flexibility in the formatting output according to your specific requirements. |
Reffered: https://www.geeksforgeeks.org
Geeks Premier League |
Type: | Geek |
Category: | Coding |
Sub Category: | Tutorial |
Uploaded by: | Admin |
Views: | 10 |