Skip to content
seekho.
← Python Programming: Zero to Advanced

Whole course on one page

Python Programming: Zero to Advanced: 9 lessons, a few lines each. About 5 minutes to read. Use it to preview the course or to revise.

First Steps with Python

  1. 1. What Is Programming and Why Python? opens the one-minute view

    A program is a list of instructions. The computer follows them one by one, exactly as written. Python is a language for writing them that reads almost like English.

    Steps: 1. Install Python from python.org · 2. Open a terminal · 3. Type python and press Enter · 4. Type print("Hello, Seekho!") · 5. Change the text to your name

    ✗ Writing a loose instruction and hoping the computer will guess. ✓ Write every step clearly and exactly.

    Words: Program, Programming language, print, String

    📌 A computer does exactly what you say, so say it clearly.

  2. 2. Variables: Labelled Boxes for Your Data opens the one-minute view

    A variable is a name that holds a value. You can read the value later, or put a new value in. The equals sign means "store this value under this name".

    Steps: 1. Make a variable called city · 2. Make a variable temperature · 3. Print a sentence using both · 4. Change temperature and print again · 5. Run type(temperature)

    ✗ Reading = as "is the same as", like in maths. ✓ Read = as "put this value into this box".

    Words: Variable, Value, Type, Boolean

    📌 The equals sign means "store this", not "is the same as".

  3. 3. Making Decisions with if opens the one-minute view

    An if statement lets a program choose. It asks a yes or no question, called a condition. Python checks from top to bottom and runs only the first block that matches.

    Steps: 1. Store a number in hour · 2. Write if hour < 12: · 3. Write elif hour < 18: · 4. Write else: · 5. Test with 9, 15 and 21

    ✗ Starting the print line at the left edge, with no spaces. ✓ Put four spaces before each line inside a choice.

    Words: Condition, elif, else, Indentation

    📌 Python runs only the first branch whose condition is true.

Working with Collections and Repetition

  1. 4. Lists and Loops opens the one-minute view

    A list holds many values in order. A for loop takes each item in turn and repeats the same action for it. Python counts list positions starting from 0.

    Steps: 1. Make a list of five numbers · 2. Start a variable total at 0 · 3. Loop and add each number to total · 4. Print the total · 5. Divide total by len of the list

    ✗ Writing fruits[1] to get the first item. ✓ Write fruits[0] to get the first item.

    Words: List, for loop, Index, append

    📌 Python counts list positions starting from zero.

  2. 5. Dictionaries: Looking Things Up by Name opens the one-minute view

    A dictionary stores pairs. Each pair has a key and a value. You give the key and Python gives back the value, so you find data by name.

    Steps: 1. Make a dictionary of three prices · 2. Print the price of one item · 3. Change one price · 4. Loop and print every pair · 5. Use get for a missing item

    ✗ Using student["phone"] when the key may not exist. ✓ Use student.get("phone", "not given").

    Words: Dictionary, Key, Value, get

    📌 Lists find by position. Dictionaries find by name.

  3. 6. Functions: Reusable Mini-Machines opens the one-minute view

    A function is a set of steps with a name. You give it inputs, it does one job and gives back a result. You can use it again and again.

    Steps: 1. Write def and a clear name · 2. Return the result · 3. Call it with 0, 37 and 100 · 4. Print each result · 5. Use it inside a second function

    ✗ Putting many different jobs into one big function. ✓ Give each function one job and a clear name.

    Words: Function, Parameter, Return value, def

    📌 A function takes inputs, does one job, and returns an output.

Growing into an Advanced Python Developer

  1. 7. Handling Errors and Reading Files opens the one-minute view

    Things go wrong, like a user typing letters where a number is needed. try and except let the program react and carry on. Files keep data after the program closes.

    Steps: 1. Ask for two numbers · 2. Put the risky lines under try · 3. Catch ValueError · 4. Catch ZeroDivisionError · 5. Save the result with with open

    ✗ Catching every kind of error with one except. ✓ Catch only the specific errors you expect.

    Words: Exception, try / except, ValueError, with

    📌 Catch the specific errors you expect, and let the rest show up.

  2. 8. Classes, Modules and Testing Like a Pro opens the one-minute view

    Three things keep a growing program tidy. A class is a plan for making objects. A module is a file of code you can import. A test is code that checks your code.

    Steps: 1. Create bank.py with the class · 2. Add a withdraw method · 3. Install pytest in a virtual environment · 4. Write two tests and run pytest

    ✗ Installing packages for all projects in one shared place. ✓ Install with pip inside a virtual environment for each project.

    Words: Class, Object, Module, Test

    📌 A class is the plan, a module is the file, a test is the check.

  3. 9. Final Project: Personal Expense Tracker opens the one-minute view

    In this project you build a small expense tracker that runs in the terminal. The user adds expenses, lists them and sees totals. The program saves them to a file.

    Steps: 1. Define what one expense holds · 2. Build a text menu · 3. Save to a file and load at start · 4. Handle bad input with try/except · 5. Split into modules and add tests

    ✗ Trying to build every requirement at once. ✓ Start with the smallest version that works, then add one thing.

    Words: Command-line app, Category, Logic

    📌 Start small, add one requirement at a time, and test as you go.

This page is a summary. It does not replace the lessons, where each idea has an example, pictures and practice.