Türk Web Site Web Design · Software

Python from Scratch, Lesson 1: Installing Python and Your First 5 Commands

The first lesson of the Python from Scratch series: we install Python, type five real commands and read our first error messages. With the video and slides, for people who have never written code.

Pastel renkli sınıfta öğretmen, iki öğrenciye bilgisayar ekranındaki Python logosu üzerinden programlama öğretiyor.

Most people who start learning Python get stuck in the same place: books and videos explain theory at length, and the first line of code comes much later. In this series we do the opposite. First we install Python on your computer, then we immediately type five real commands and read our first error messages together. No memorising.

This article is the written version of the first lesson in the Python from Scratch series on our YouTube channel. The video is in Turkish; you can follow along here in English. The images in this article are the slides from the video.

In this lesson:

  • We install Python on Windows with the Python install manager (with a note for Mac).
  • We use Python as a calculator: addition, multiplication, division and powers.
  • We print text to the screen with print.
  • We make three mistakes on purpose and read what the error messages say.
  • We use variables to write our first small program, a price calculator.

About the code: The code is exactly the same as in the video, so a few words are Turkish. Merhaba Dünya means "Hello World", fiyat means price, adet means quantity, Toplam means total and dogum_yili means year of birth. You can use English words in your own code.

What is Python, and why start with it?

Python is a programming language we use to tell the computer what to do. Its commands are close to English and easy to read. For example, the command that writes something on the screen is called print.

Python is widely used behind websites, in data work and in AI tools. For a beginner, its biggest advantage is this: you can type a one-line command and see the result right away. In this series we move step by step: first commands today, then files, decisions, loops, lists and functions.

How to install Python (Windows)

If Python is already installed on your computer, you can skip this part and go straight to the first command.

On Windows the easiest way is the Python install manager. It is the official program from the Python Software Foundation, and it downloads and installs Python for you:

  1. Open Microsoft Store from the Start menu.
  2. Type Python install manager into the search box.
  3. Choose the app published by the Python Software Foundation and click Install (shown as "Yükle" on the Turkish slide).

If you prefer not to use the Store, you can get the same program from the python.org downloads page. Both are the same program.

Python install manager in the Microsoft Store search box with the Install button
Search the Microsoft Store for "Python install manager" and install the app from the Python Software Foundation.

When the installation finishes, type terminal into the Start menu and open Terminal. A dark window appears. Don't worry: this window is where we talk to the computer by typing. Type python in lowercase and press Enter.

Typing the python command in the Windows Terminal window
Type python in lowercase in Terminal and press Enter.

If there is no Python on your computer yet, the program downloads the latest version by itself the first time. If a question appears, read it; if you are not sure, accept the default answer.

Then you will see three greater-than signs: >>>. This sign means "Python is ready and listening". Whatever you type here runs the moment you press Enter.

Three greater-than signs in the terminal: Python is waiting for a command
If you see the three greater-than signs, Python is waiting for a command.

On a Mac: Install the Mac version from python.org, then type python3 in Terminal. Everything else is the same.

Command 1: Using Python as a calculator

Our first command is a sum. Type the following lines one by one next to the three greater-than signs and press Enter after each:

>>> 2 + 3
5
>>> 10 * 5
50
>>> 7 / 2
3.5

Multiplication uses an asterisk (*) and division a forward slash (/). Python writes decimals with a dot.

Addition, multiplication and division in Python with their results
The signs for addition, subtraction, multiplication and division. Decimals use a dot.

Command 2: Powers with two asterisks

Two asterisks side by side (**) mean "to the power of". Type 2 ** 10: two to the tenth power, which is 1024. A calculation that is hard to do in your head takes Python no time at all.

The result of 2 ** 10 in Python is 1024
Two asterisks raise a number to a power: 2 ** 10 is two multiplied by itself ten times.

Command 3: Printing text with print

A programmers' tradition: making the computer say "Hello World". Type this:

>>> print("Merhaba Dünya")
Merhaba Dünya

The command has three parts. print means "write to the screen". The brackets hold what should be written. The quotation marks tell Python "this is text, show it exactly as it is".

The parts of the print command: print, brackets and quotation marks
print writes to the screen, the brackets hold what to write and the quotes show the text as it is.

Let's make three mistakes on purpose

Getting errors is part of the lesson. Python's error messages look scary at first, but they actually tell you where to look.

Error 1: Forgetting the quotes (NameError)

Type the same command without quotes: print(Merhaba). Python answers NameError: name 'Merhaba' is not defined, in other words "I don't know anything called Merhaba". Without quotes, Python thinks the word is a name, not text.

The NameError message from a print command without quotes
Without quotes, Python treats the text as a name and raises a NameError.

Errors 2 and 3: An unclosed quote and a capital P

If you open a quote and never close it, you get a SyntaxError, which is a spelling mistake in the code. If you write Print instead of print, Python gives a NameError again and even asks Did you mean: 'print'? The lesson here: an error message is not an enemy, it is a clue. Upper and lower case matter in Python.

SyntaxError for an unclosed quote and the error for Print written with a capital P
An unclosed quote gives a SyntaxError. For Print with a capital P, Python suggests the right spelling.

Command 4: What is a variable?

A variable is a name we give to a piece of information. Think of it as a box with a label: the label is the variable's name and the content is its value.

>>> fiyat = 1500
>>> adet = 3

This time Python shows nothing, because it only remembers the values. The equals sign puts the value on its right into the name on its left. Here fiyat is the price and adet the quantity.

A variable as a labelled box: 1500 in the fiyat box, 3 in the adet box
A variable is a labelled box: the fiyat box holds 1500, the adet box holds 3.

Command 5: Your first program, a price calculator

Now let's combine the two variables:

>>> print(fiyat * adet)
4500
>>> print("Toplam:", fiyat * adet, "TL")
Toplam: 4500 TL

Python took the values out of the boxes and multiplied them. In the second line we added text inside print, separated by commas: Python writes the comma-separated parts side by side with a space between them. That is your first small program.

print with price times quantity and the output Toplam: 4500 TL
A comma puts text and a number side by side: Toplam: 4500 TL.

AI corner: How to ask about an error

When you get stuck on an error, you can ask ChatGPT or Claude. But how you ask matters. If you say "fix this", the AI writes the code for you and you learn nothing. Paste the error message and add this:

I've just started learning Python. Don't fix the code for me. Just explain what the error means and where I should look.

A wrong and a right way to ask an AI about a Python error
Instead of "fix this", ask what the error means.

Homework: Let Python work out your age

Create a variable called dogum_yili and put your year of birth in it. Then work out your age with print(2026 - dogum_yili). You will see either your age or your age plus one. Think about why it is sometimes one too high; we answer this at the start of the second lesson.

Homework: the dogum_yili variable and working out your age from 2026
Homework: work out your age from your year of birth. Why is it sometimes one too high?

Next in the series

Learn Python, we'll build your website

Learning to code takes time; your business's online presence shouldn't have to wait. TurkWebsite builds your site with affordable web design and free hosting while you keep going with Python.

Website Packages Message Us on WhatsApp

Quick answers

Do I need to know how to code before learning Python?
No. This lesson is made for people who have never written code. It starts with installation, has you type the first commands one by one and shows how to read error messages.
How do I install Python on Windows?
Search the Microsoft Store for the Python install manager app and install it, or get the same program from the python.org downloads page. After installing, open Terminal and type python; the program downloads the current Python version and opens the prompt with three greater-than signs.
What do the three greater-than signs (>>>) mean in Python?
They show that Python is waiting for a command. Every command you type next to them runs as soon as you press Enter, and the result appears right below.
What does NameError: name is not defined mean?
It tells you that you used a name Python doesn't know. For beginners the most common causes are forgetting to put text in quotes or writing a command such as print with a capital letter.
What is a variable in Python?
It is a name given to a value. When you write fiyat = 1500, Python remembers the value 1500 under the name fiyat, and you can then use that name in calculations such as print(fiyat * 3).

Services we can help you with on this topic

TSWS-01

One-Page Website

Services, contact and call buttons on one page; a fast, mobile-friendly starter site.

from $249
BES-01

Starter E-Commerce Website

A fast start to online sales: 100 products loaded, payment and shipping connected, mobile-ready store.

from $849
Chatbots · 5 to 7 business days

WhatsApp Business Bot

Answers price, availability and shipping questions instantly after hours; books appointments and takes orders.

from $349

Other posts

All posts
9 November 2026 · 16 min

Claude Code Instagram Skills

Pastel illustration of Claude Code automating Instagram content on a laptop and smartphone.

6 November 2026 · 8 min

What Is Email Warm-Up?

Sending to your whole list at once from a new domain lands you in spam; a warm-up plan based on Google's guidance.

  • python for beginners
  • learn python from scratch
  • python lesson 1
  • install python windows
  • python install manager
  • python print
  • python variables
  • python nameerror
  • first python commands
  • python tutorial

Describe your business in one sentence and we will send the package and price in writing

The first call is free. If you have a domain or an existing site, send us the link; we reply within 1 business day.