SyntaxStudy
Sign Up

print()

function

Prints objects to the text stream, separated by sep and followed by end.

Syntax

print(*objects, sep=" ", end="\n", file=sys.stdout)

Example

python
print('Hello, World!')
print('Name:', 'Alice', sep='_')  # Name:_Alice
print('A', 'B', 'C', sep=', ')   # A, B, C
print('No newline', end='')

# f-string
name = 'Alice'
print(f'Hello, {name}!')