pySohila’s learning labPYTHON / FIELD GUIDE 01

Think in Python / CORE PATH

Testing & debugging

A failing example is evidence you can narrow to a specific cause.

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

Apply your troubleshooting habit: reproduce, inspect, change one thing, verify.

Understand the idea

A failing example is evidence you can narrow to a specific cause. Apply your troubleshooting habit: reproduce, inspect, change one thing, verify.

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 mean_or_none(values):
    return sum(values) / len(values) if values else None

assert mean_or_none([0, 10]) == 5

Practice on your own data

Task 05: fix mean_or_none so empty data is meaningful and zero is retained.

Practice this lesson in the Python lab →

EXIT CHECK

mean_or_none([]) is None; mean_or_none([0, 10]) is 5.

Common pitfalls

Prerequisites

Scope & side effects

Boot.dev chapter 5 · 01:28:55 ↗

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 ↗