A beginner-friendly collection of Python lessons, examples, and practice ideas. The goal is to help new programmers learn the language one topic at a time.
- Getting started — what Python is, installing it, and running a first program.
- Variables and data types — strings, integers, decimals, booleans, and type conversion.
- Input and output — reading information with
input()and displaying results withprint(). - Operators — arithmetic, comparison, logical, and assignment operators.
- Decisions — using
if,elif, andelse. - Loops — repeating instructions with
forandwhile. - Functions — organising code into reusable blocks.
- Data structures — lists, tuples, sets, and dictionaries.
- Strings — indexing, slicing, formatting, and common string methods.
- Files and errors — reading and writing files and handling exceptions.
- Object-oriented programming — classes, objects, methods, and inheritance.
- Modules and packages — importing and reusing code.
name = input("Enter your name: ")
print(f"Hello, {name}!")- Python 3
- A code editor, such as Visual Studio Code
- A terminal or command prompt
Check that Python is installed:
python --versionOn some systems, use python3 --version.
Open the folder containing a lesson and run its Python file. For example:
python main.pyUse python3 main.py if that is the command for your system. The exact file name may differ between lesson folders.
After learning the basics, try building a calculator, number guessing game, quiz, to-do list, contact manager, or expense tracker.
By working through the material, learners can practise writing Python code, using common data types, controlling program flow, creating functions, and organising small programs.
This repository is a learning resource. Lesson coverage and examples may grow over time. Check the files in the repository for the material currently available.
Created by eDDie for Python learning and practice.