Python · Beginner

Python Fundamentals

Learn Python completely from scratch, one small idea at a time, no coding experience assumed.

Units
4
Lessons
20
Practice questions
58
Minutes
~300

Start learning today

Try every course free for 7 days. After that, this course is in Learnix Pro (KES 699/month).

Create free account Log in

What you'll learn

Write and run your very first Python script

Store and use information with variables

Make your program decide and repeat things

Write your own reusable functions

Organize information with lists and dictionaries

Understand what pip and virtual environments are for

How the lessons work

Clear explanations

Step-by-step lessons in plain language

56 in this course

Worked examples

Real code and examples you can copy and run

77 in this course

Quick checks

Test your understanding as you go

38 in this course

Fill the blank

Recall the key commands and syntax

20 in this course

Hands-on workspace

A practical task at the end of every lesson

20 in this course

Syllabus

  1. 1.1

    Your First Python Program

    A Python program is just a list of instructions, followed in order, top to bottom, like a recipe. Let's write and understand your very first one.

  2. 1.2

    Variables & Data Types

    A variable is just a labeled box that holds a value: you can look inside it, use what's inside, or put something new in later.

  3. 1.3

    Working with Text: String Methods & Formatting

    Almost every program cleans, searches or formats text. Learn the string methods you will use every day and how to print tidy results.

  4. 1.4

    Making Decisions & Repeating Things

    This is where that "indentation matters" note from lesson one finally makes sense: it's exactly how Python shows what belongs inside a decision or a loop.

  5. 1.5

    Loops in Depth: range, enumerate, zip, break & continue

    Go beyond the basic for loop: count with range, number items with enumerate, walk two lists together with zip, and control loops with break and continue.

  1. 2.1

    Functions: Naming a Set of Steps

    A function is a named, reusable chunk of instructions: write it once, then just call its name whenever you need those steps again.

  2. 2.2

    Organizing Data: Lists & Dictionaries

    A list is an ordered row of items, like a numbered shelf. A dictionary is a set of labeled values, like a filing cabinet with named folders.

  3. 2.3

    Tuples, Sets & Choosing the Right Collection

    Lists and dictionaries have two useful cousins: tuples for fixed records and sets for unique values. Learn when each one is the best choice.

  4. 2.4

    Comprehensions, Lambdas & Sorting

    Build new lists and dictionaries in one readable line, write tiny throwaway functions with lambda, and sort data by any field.

  5. 2.5

    Working with Dates and Times

    Almost every real program eventually needs to know "what day is it" or "how long until then": Python's datetime module handles the surprisingly fiddly math for you.

  1. 3.1

    Modules, pip, and Virtual Environments

    You almost never write everything from scratch: import lets you reuse code someone else already wrote, and pip is how you get hold of it.

  2. 3.2

    Reading and Writing Files

    Every program so far has forgotten everything the moment it stops running. Files are how a program remembers something for next time: write it down now, read it back later.

  3. 3.3

    Handling Errors Gracefully with try/except

    Things go wrong: a file might not exist, someone might type text where a number was expected. try/except lets your program handle that gracefully instead of crashing outright.

  4. 3.4

    Working with JSON and API-Style Data

    Almost every web service on the internet speaks JSON. Python's json module translates effortlessly between JSON text and Python's own dictionaries and lists.

  5. 3.5

    Automating Spreadsheet Reports with CSV

    Turn a raw sales export into a summary report: read CSV rows, group and total them, and write a clean report file that opens in Excel.

  1. 4.1

    Classes and Objects: Bundling Data and Behavior

    A class is a blueprint for creating objects that carry their own data around with them, along with the actions that work on that data.

  2. 4.2

    Inheritance & Dataclasses

    Share behaviour between related classes with inheritance, override methods, and cut boilerplate with dataclasses.

  3. 4.3

    Testing Your Code with assert & pytest

    Prove your functions work, and keep working after changes, with small automated tests.

  4. 4.4

    Automating Boring Tasks: Files & Folders

    Let Python rename, sort and organise files for you with pathlib, the modern way to work with paths.

  5. 4.5

    Mini Project: Personal Expense Tracker

    Combine everything (functions, dictionaries, files, errors and tests) into a small, useful program that tracks spending by category.

Earn a verifiable certificate

Finish every lesson and pass the 20-question final exam (70% to pass). Each certificate has a unique number anyone can check online.

Get started

Helping with:

🍪 We use essential cookies to keep you signed in, protect your account and remember your settings. We don't use advertising or tracking cookies. Read our Privacy Policy.