end in Python

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

Syntax :

print(*objects, sep=’ ‘, end=’\n’, file=sys.stdout, flush=False)

for i in range(1, 9):
    print i,

Output :

1 2 3 4 5 6 7 8

sep in Python

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

Syntax :

print(value1, value2, …, sep=’separator’)

print("A" + "-" + "B" + "-" + "C")

Output :

A-B-C
print("Apples", "Banana", "Mango", sep=", ", end=" are my favorite fruits!\n")

Output:

Apples, Banana, Mango are my favorite fruits!

Explore More

Input and Output in Python

Understanding input and output operations is fundamental to Python programming. With the print() function, you can display output in various formats, when the input() function/method enables interaction with users by gathering

f-strings in Python

Python offers a powerful feature called f-strings (formatted string literals) to simplify string formatting and interpolation. f-strings is introduced in Python 3.6 it provides a concise and intuitive way to embed expressions and variables

Python tutorials

We are starting a Python Tutorials Series for Beginners and Professionals. In these Python Tutorials, we will cover all the features of Python. You will learn from basic to advanced-level features