Print Function Basics

Introduction to print()

The print() function in Python is one of the most fundamental and frequently used functions. It outputs text and variables to the console.

print("Hello, World!")
Hello, World!
Read more about Print Basics

Advanced Print Features

Separator and End Parameters

Control output formatting with sep and end parameters:

print("Hello", "World", sep="-", end="!")
Hello-World!

Variables in Print

Python's print function can easily display variables of any type. Variables are automatically converted to their string representation.

number = 42 name = "Python" print(number) print("Value:", number) print(f"I love {name}!")
42 Value: 42 I love Python!
Read more about Varibles

Common Examples

Printing Variables

age = 25 print("Age:", age)
Age: 25

Multiple Arguments

Use multiple arguments to print several items at once:

print("Python", "is", "awesome")
Python is awesome
More Examples

Try It Yourself!