PYTHON · Learning guideTheory · Labs · Knowledge checks
Chapter 01

Getting started with Python

What Python is used for

Python is a general-purpose language widely used for scripting, automation, web services, data processing and testing. It is interpreted, dynamically typed and supported on major operating systems.

python --version
python -c "print('Hello, world!')"
Hands-on lab: Install Python 3 and verify the interpreter and an editor.

Development environment and style

Use a code editor or IDE, a project directory and a virtual environment. Follow PEP 8 naming and formatting conventions.

python -m venv .venv
# Linux/macOS: source .venv/bin/activate
# Windows PowerShell: .venv\Scripts\Activate.ps1
Hands-on lab: Create a project folder and run a .py file.
Quick check: Is a virtual environment a virtual machine?
Show answer
No. It isolates Python packages for a project.