pySohila’s learning labPYTHON / FIELD GUIDE 01

Think in Python / CORE PATH

Functions & explicit contracts

A function turns named inputs into a useful result with a clear contract.

3h planning budget · Sohila Khaled Abbas · Reviewed 2026-11-01

Think of a reusable Power Query function, but make data dependencies explicit.

Understand the idea

A function turns named inputs into a useful result with a clear contract. Think of a reusable Power Query function, but make data dependencies explicit.

Work through the practice with a tiny fixture, predict the result before running it, and record one boundary case. Use the exit check as evidence before moving on.

What to learn

A small original example

def net_revenue(gross, discount):
    if not 0 <= discount <= gross:
        raise ValueError("discount outside gross amount")
    return gross - discount

Practice on your own data

Task 03: calculate net revenue from gross and discount piastres.

Practice this lesson in the Python lab →

EXIT CHECK

net_revenue(10000, 1500) is 8500; a discount larger than gross is rejected.

Common pitfalls

Prerequisites

Variables, types & missing values

Boot.dev chapter 3 · 43:06 ↗

Video and playlist companions

Choose one explanation for the concept, then attempt the practice. These are topic mappings, not a claim that every linked lesson covers every outcome.

Boot.dev · Python for Beginners

Loads YouTube on request. Open on YouTube ↗ if the owner restricts embedding.

كورس Python منحة ITI

Loads YouTube on request. Open on YouTube ↗ if the owner restricts embedding.

Python - The Basics - Part 1 | جحر السوعبان

Loads YouTube on request. Open on YouTube ↗ if the owner restricts embedding.

Python Full Course for Beginners (13 Hours) – From Zero to Hero

Loads YouTube on request. Open on YouTube ↗ if the owner restricts embedding.

03 تعليم الآلة , القسم الثالث : بايثون Machine learning , Python

Loads YouTube on request. Open on YouTube ↗ if the owner restricts embedding.

Sources and further reading

Track progress on this topic → · Markdown source ↗