In Python, printing refers to displaying output on the screen. This is done using the built-in print() function. It is one of the most commonly used functions and is essential for displaying messages, results, and program outputs.
print() FunctionThe print() function is used to display text, numbers, variables, and other data types on the screen.
print(object(s), sep=separator, end=end_character)print()object(s)The data to be printed (strings, numbers, variables, etc.)
sep (optional)Specifies the separator between multiple valuesDefault value: space " "
end (optional)Specifies what to print at the endDefault value: newline \n
print("Hello, World!")Output
Hello, World!Explanation
print("Python", "is", "easy")Output
Python is easyExplanation
sep Parameterprint("2026", "03", "20", sep="-")Output
2026-03-20Explanation
-.end Parameterprint("Hello", end=" ")print("World")Output
Hello WorldExplanation
print() does not move to a new line.name = "Rahul"age = 20 print("Name:", name)print("Age:", age)Output
Name: RahulAge: 20print(10)print(3.14)print(True)Output
103.14Truename = "Amit"marks = 85 print(f"Name: {name}, Marks: {marks}")Output
Name: Amit, Marks: 85Explanation
print("Hello\nWorld")Output
HelloWorldCommon Escape Characters
| Escape | Meaning |
|---|---|
\n | New line |
\t | Tab space |
\\ | Backslash |
print() is used to display output in Python.sep controls separation between values.end controls what is printed at the end.