Last updated

Python Get Started

Definition: print() is a built-in function that displays (outputs) whatever you put inside its brackets onto the screen.

On your own computer you would install Python from python.org and run .py files. Here, the editor already runs Python for you — nothing to install.

Example 1 — printing text

print("Hello, World!")
print("Welcome to Python")

Each print() puts its message on a new line.

Example 2 — printing numbers and maths

Quotes are only for text. For numbers, leave them off so Python treats them as values, not words:

print(100)
print(5 + 3)
print(10 * 4)

This shows 100, then 8, then 40 — Python does the maths first, then prints the answer.

Example 3 — printing several things together

Put commas between items and print() shows them on one line with a space between:

print("The answer is", 6 * 7)

💡 Common mistake: writing print(Hello) without quotes makes Python look for a variable called Hello and error. Text always needs quotes.

Try it Yourself
Output

          
Ad · responsive