pySohila’s learning labPYTHON / FIELD GUIDE 01

Think in Python / CORE PATH

Scope & side effects

Local names help a function behave predictably across calls.

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

Avoid notebook state that makes a cell work only after an undocumented execution order.

Understand the idea

Local names help a function behave predictably across calls. Avoid notebook state that makes a cell work only after an undocumented execution order.

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 classify_copy(record, category):
    result = dict(record)
    result["category"] = category
    return result

Practice on your own data

Task 04: add a category to a copied record without changing the original.

Practice this lesson in the Python lab →

EXIT CHECK

The original dict stays identical after classify_copy(record, "Food").

Common pitfalls

Prerequisites

Functions & explicit contracts

Boot.dev chapter 4 · 01:16:12 ↗

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.

Sources and further reading

Track progress on this topic → · Markdown source ↗