HexLibraryHexLibrary
</> HexCodeSign inSign up
PythonJavaScriptTypeScriptCC++JavaPHPGoRustRubyBashSQLLuaPerlCOBOLPascalDelphiFortranDartSwiftC#JuliaGroovyRElixirHaskellKotlinScalaClassic ASPClipperMS-DOS
LESSONS
Introduction to Python: Print and RepeatVariablesData Types & NumbersStringsListsConditions (if / elif / else)Loops (for / while)FunctionsOperatorsDictionariesTuples & SetsError Handling (try / except)Classes (Object-Oriented)File OperationsComments & IndentationBooleans (True / False)Lambda & map / filterModules (import)InheritanceVariable Scope
REFERENCE
📖 Overview
🖥️ Output & Input
print()input()f-string
🔢 Numbers & Math
✍️ String
📋 List
🗂️ Dictionary & Set
🔁 Condition & Loop
🧩 Function
📁 File & Error
🔄 Type & Conversion
Python›REFERENCE›Output & Input›print()

print()

Writes the given values to the screen.

Syntax

print(*values, sep=' ', end='\n')

Description

Prints the value(s) inside the parentheses to the screen. You can pass several values separated by commas; by default it puts a space between them and moves to a new line at the end. You can change this behavior with sep and end.

Parameters

*valuesOne or more values to print.
sep(optional)The separator placed between values (default: a space).
end(optional)The text added at the end of the line (default: a newline).

Returns

Returns nothing (None); it writes to the screen.

Example

Loading editor…

Expected output

Hello World
A-B-C
side by side continues

When to use?

The most-used command for showing a program's result to the user and for seeing variables' values while debugging.

Common mistakes

  • ⚠️ Forgetting to put the text in quotes: print(Hello) gives an error, print("Hello") is correct.
  • ⚠️ Forgetting that sep and end are only given as keyword arguments.

Related commands

input()f-string
input() →
HexLibraryHexLibrary

Learn programming more clearly. Every command is explained line by line with colors, reinforced with runnable exercises, test your code instantly — all in one place, free.

Learn

  • Home
  • Languages & Lessons
  • HexCode

Company

  • About
  • Contact

Legal

  • Privacy Policy
  • Terms of Use

Other Projects

  • HexToolz
  • Free Service Manuals
© 2026 HexLibrary · The clearest way to learn code