o‘zing o‘rgan
Python Basics Lesson 1 / 75
Pito

print() and your first program

Showing text and numbers on screen

Chapter 1. Basics 10 minutes Video Python 3 questions

Programming means giving a computer precise instructions. The very first instruction in Python is print(). It shows whatever is inside the parentheses on the screen.

print("Hello, world!")
# Output: Hello, world!

Text goes inside double quotes ("...") or single quotes ('...'). Numbers written without quotes are calculated:

print(2 + 3)      # Output: 5
print("2 + 3")    # Output: 2 + 3

If you pass several values separated by commas, print shows them separated by spaces:

print("Group:", "25-407", "year:", 2)
# Output: Group: 25-407 year: 2

💡 Everything after # is a comment. Python ignores it — it is for you.

Common mistakes

  • Print("hi") — Python is case-sensitive. Correct: print.
  • print("hi) — the quote is not closed → SyntaxError.
  • print hi — no parentheses or quotes → SyntaxError.

Video lesson

Practice Python

Print two lines exactly like this:

Salom, O'zing Organ!
Men Python o'rganyapman
main.py Ctrl+Enter — run
input() data
Write code and press "Run". Loading Python takes a few seconds the first time.
Show solution
print("Salom, O'zing Organ!")
print("Men Python o'rganyapman")

Check yourself

Question 1 / 3

What does print("5 + 5") show?

Choices

Question 2 / 3

Which line runs without an error?

Choices

Question 3 / 3

What is text written after #?

Choices