Home · Academy · Robotics & Coding · Python Fundamentals · What Is Python and Where Is It Used?

What Is Python and Where Is It Used?

Learn what Python is, why it is readable and versatile, and where it is used in web, data, AI and robotics.

LESSON COMPASS

What will you use this page for?

Core idea

Python is an easy-to-read programming language, close to human language, and it is used in many different places — from websites and artificial intelligence to robots and automation.

Evidence to produce

Complete the page task with your own input, test conditions and reasoning.

Control trap

Forgetting the quotation marks The text you want to print must be inside quotation marks. Wrong: print(Hello) . Right: print("Hello") . Without the quotes, Python thinks "Hello" is a command and gives an error. Getting the indentation wrong The commands below an if or for line must start further in. If you forget the…

Next connection

The Development Environment and Your First Program: We will install Python on your computer and learn to actually run your first program.

Module sources: Python Tutorial · Arduino Learn

LevelBeginner
Age10–16
Duration30–45 min
PrerequisiteAlgorithm basics; Scratch experience is useful
ContentStandard lesson · 1,443 words
Last updated

One-sentence summary

Python is an easy-to-read programming language, close to human language, and it is used in many different places — from websites and artificial intelligence to robots and automation.

Why does it matter?

Until now you have dragged and dropped blocks in Scratch. Blocks are great for getting started: you can see the commands and you cannot snap them into the wrong place. But once you begin writing large projects, blocks slow down and the screen gets crowded.

A text-based language lets you type the commands with a keyboard instead. You write faster, you can copy and share your code easily, and you move on to the tools that professionals use.

Python is one of the most recommended languages for making that move to text-based coding. Its commands read almost like plain English sentences. In this lesson we will learn what Python is, where it is used, and how it takes the place of blocks.

Short definition: Python is an easy-to-read programming language in which we write commands as plain text, and it is used across many fields.

What is Python?

A programming language is a language we use to tell a computer what to do. People speak languages such as English or Turkish; to give commands to a computer, we use a programming language.

Python was released in 1991 by Guido van Rossum. Its name does not come from the snake but from a comedy group ("Monty Python"). The thing its creator cared about most was that code should be readable.

Why is Python readable?

The command below prints a message on the screen:

print("Hello world")

Even someone who has never seen code can roughly read this line: "print" means display, and the text inside the quotation marks is what will appear on the screen. When you run it, you see:

Hello world

Doing the same job in another language might take more lines and more complicated symbols. Python reduces it to a single line. The simpler the code is, the easier it becomes to find a mistake.

You can also give print more than one piece of text. If you put a comma between them, Python writes them side by side:

print("Hello", "Doruk")

This line prints Hello Doruk on the screen. As you can see, the command is the same; only the text we put inside it changes.

Indentation matters

In Python we show which block a command belongs to by using indentation. Indentation is the space at the start of a line. We usually use 4 spaces.

age = 12

if age >= 10:
    print("This lesson is right for you")
    print("Let's begin")

Here the two lines below the if line start 4 spaces in. That space tells Python, "these lines are inside the condition." In Scratch, blocks nested inside one another; in Python, indentation does the same job.

Where is Python used?

Python does not belong to a single field. You can use the same language for very different jobs. Here are the most common areas:

Web, data and artificial intelligence

Automation and robotics

For example, we can make a robot beep 3 times like this:

for i in range(3):
    print("Beep")

The phrase for ... in range(3) means "repeat this 3 times." Do you remember the "repeat 10 times" block in Scratch? This is its written form.

From blocks to text-based code

The ideas you learned in Scratch are not lost; only their appearance changes. The same three basic structures exist in Python too: sequence, condition and repetition.

Comparing blocks with Python

In Scratch, when you wanted a character to say "Hello," you used a purple "say" block. In Python the same idea is a single line:

Comparing blocks with Python table
Scratch blockPython code
repeat 10for i in range(10):
if ... thenif ...:
say ...print("...")
set variable to ...variable = ...

Two examples side by side

A condition example. In Scratch you would stack "if score > 100 then say 'You win'" blocks. In Python it looks like this:

score = 120

if score > 100:
    print("You win")
else:
    print("Keep going")

The logic here is exactly the same as in Scratch. Instead of dragging blocks, you type the lines. The word else means "otherwise"; it matches the "if-else" block from Scratch.

Mini practice

Write the short program below on paper or in a notebook. You do not need to run it on a computer yet; our goal is to read the code and predict what it will do.

print("Name: Doruk")
print("Favourite subject: coding")

for i in range(2):
    print("I am learning Python")

Tasks

  1. How many lines does this program print on the screen? Count them and note it down.
  2. If you remove the last two lines (the for line and the one below it), how does the output change?
  3. Change the first two lines so they show your own name and favourite subject.
  4. If you write range(4) instead of range(2), how many times is "I am learning Python" printed?

In the next lesson we will actually run programs like these. For now, getting used to reading the logic of the code is enough.

Common mistakes

Forgetting the quotation marks

The text you want to print must be inside quotation marks. Wrong: print(Hello). Right: print("Hello"). Without the quotes, Python thinks "Hello" is a command and gives an error.

Getting the indentation wrong

The commands below an if or for line must start further in. If you forget the indentation, or use 2 spaces on some lines and 4 on others, Python gives an error. Always use the same number of spaces within one block.

Forgetting the colon

The if, else and for lines end with a colon (:). Forgetting it is one of the most common beginner mistakes.

Thinking "Python is hard"

Python was designed precisely so that beginners could read it. Typing text instead of using blocks feels a little slow on the first day; after a few tries it speeds up.

Safety note

Coding is a safe activity that runs on your screen. Even so, keep two simple rules in mind: do not blindly run code you found online or that someone sent you; only run code you understand and trust. Also, do not put personal information such as your real address, phone number or passwords into your programs. If you are going to install a new program or tool, do it together with an adult.

Review questions

  1. What makes Python suitable for a first text-based programming language?
  2. How does an interpreter differ from a program that is compiled before running?
  3. Why does readable code still require careful design and testing?
  4. Which tasks are appropriate for a small beginner Python project?
  5. What should be checked before running code copied from the internet?
  6. How can a tiny program demonstrate input, processing and output?

Answers

  1. Its syntax is relatively readable, it has broad learning resources and it supports projects from simple scripts to data and hardware work.
  2. An interpreter executes Python instructions through the Python runtime, while compiled workflows translate code into another form before execution.
  3. Readable syntax does not guarantee correct requirements, safe inputs, accurate calculations or sensible structure.
  4. Examples include a quiz, calculator, study planner, text analyser or small data summary with clear boundaries.
  5. Understand every line, verify the source, inspect file and network actions, check dependencies and run it in a safe environment.
  6. Read a value, transform or compare it, and print a result together with a helpful label.

Lesson summary

Check your understanding

  1. What is the most important feature that makes Python easy to read?
  2. What appears on the screen when print("Hello world") runs?
  3. In Python, what decides which block a command belongs to?
  4. Name three different fields where Python is used.
  5. What is the Python equivalent of the Scratch "repeat 10 times" block?

Answers

  1. The fact that the code reads almost like everyday language; commands are written clearly and simply.
  2. The text Hello world appears on the screen, without the quotation marks.
  3. Indentation, that is, the space at the start of a line (usually 4 spaces).
  4. For example: websites, data analysis, artificial intelligence, automation and robotics/micro:bit (any three).
  5. The phrase for i in range(10):; it is used to repeat a job a set number of times.

Source and verification note

For “What Is Python and Where Is It Used?”, verification focuses on whether the relationship between What is Python? and Indentation matters remains consistent across examples. Code examples follow Python 3 syntax. Small differences may appear between environments, so examples should first be tested in a safe online editor or a local development setup.

Next lesson

The Development Environment and Your First Program: We will install Python on your computer and learn to actually run your first program.

Start QuizBack to Python Fundamentals
QUESTION POOL

Reinforce this lesson with 10 questions

This lesson has a pool of 20 questions. Each attempt selects 10 and reshuffles the choices.