← Learning Hub
Beginner

Python Introduction

Python is one of the easiest programming languages to learn. It is used for websites, data analysis, automation, AI and machine learning, and even games.

Python code reads almost like English. There are no semicolons and no curly brackets: indentation (spaces at the start of a line) shows which lines belong together.

A programming language is a way to give instructions to a computer. The computer does exactly what you write, step by step, very fast - it never gets tired and never guesses. Python was designed to be easy for people to read, so beginners can focus on solving the problem instead of fighting with complicated symbols.

Python runs your code line by line from top to bottom. This makes it easy to try small ideas: write a line, run it, see what happens, change it. That's exactly how professional programmers work too.

Why so many people choose Python

  • Easy to start: a working program can be a single line
  • Used everywhere: Instagram, YouTube and Netflix use Python; data scientists and AI researchers use it daily
  • Huge library: thousands of ready-made tools for Excel files, websites, charts, AI and more, so you rarely start from zero
  • Jobs: Python appears in job posts for developers, data analysts, testers and automation engineers

Your first program

Example
You can edit this code.

print is a function - a ready-made command that does a job. You give it something inside the round brackets, and it shows that on the screen. Text must be inside quotes, so Python knows it's text and not a command. Almost every program you write while learning will use print to show results.

To run Python on your computer, install it from python.org, save your code in a file such as hello.py, and run it in a terminal:

Example
python hello.py

A terminal (Command Prompt or PowerShell on Windows, Terminal on Mac) is a window where you type commands. python hello.py tells the computer: "start Python and run the instructions in hello.py". You can also use an editor like VS Code or a free online Python editor, which have a Run button.

  • print() shows text on the screen.
  • Lines starting with # are comments. Python ignores them.
  • Python is case sensitive: print works, Print does not.
Press ▶ Run under an example to see its output (checked with real Python). You can edit the code too, and to see the output of your own version, run it on your computer or in an online Python editor.
Key points
  • Python is easy to read and is used for websites, data, automation and AI.
  • Code runs from top to bottom; print() shows results on the screen.
  • Indentation (spaces at the start of a line) has meaning in Python.
  • Comments start with # and are notes for humans.

📝 Test yourself

1. Which function shows text on the screen?
2. What does Python use to group lines of code together?
3. Fill in the symbol that starts a comment:
this is a comment