Week 1 - Python Foundations

Overview

Python Setup

Data Types and Variables

Control Flow: Logic and Loops

Functions and Modules

Type Hints for Clearer Code

Command-Line Interface Habits

🐛 Errors and Debugging

📝 Logging in Python

File Operations

Azure Setup and Account Access

🛠️ Practice

🎒 Assignment

⚠️ Gotchas & Pitfalls

🗓️ Lesson Plan

🗓️ Lesson Plan

Welcome to the Data Track! You have read the material and set up your environment, so today is about consolidation and preparation.

We aren't just learning "how to write Python"; we are reviewing how to structure Data Engineering projects. We will review your setups, refactor basic code into professional modules, and ensure you are fully prepared to tackle the Week 1 Assignment.

Goals

By the end of this lesson, students should be able to:

Validate* their development environment setup (VS Code, Venv, Git).

Refactor* basic scripts into modular, type-hinted code.

Diffrentiate* between humble print() debugging and professional Logging.

Understand* the requirements and potential pitfalls of the Week 1 Assignment.

Troubleshoot* common Azure login issues.

Schedule

Time Activity Duration
0:00 Welcome & Kickoff 5 min
0:05 Live Kahoot Quiz (Knowledge Check) 10 min
0:15 Workshop: Python Setup (Hands-on) 15 min
0:30 Overview: The Core Language (Ch 2-5) 20 min
0:50 Break 10 min
1:00 Overview: Engineering Habits (Ch 6-9) 20 min
1:20 Assignment Launch: The Data Cleaner 25 min
1:45 Azure Access Check 5 min
1:50 Q&A & Next Week Preview 10 min
2:00 End -

Total: 2 hours


Live Kahoot Quiz

Goal: Verify understanding of Week 1 reading material.

Topics to include

  1. Python Basics: Mutable vs Immutable (List vs String).
  2. Virtual Environments: What happens if you don't use one?
  3. Professional Habits: PEP 8, Type Hint syntax.
  4. CLI: Exit codes (0 vs 1), Argument parsing.
  5. Debugging: Reading stack traces (Bottom-up).
  6. File I/O: csv.DictReader benefits, json serialization.

Workshop: Python Setup (Hands-on)

Goal: Critical Path. No student leaves without a working local environment.

Checklist (Do this together)

  1. Python Version: python --version (Must be 3.10+).
  2. The Venv:
  1. VS Code Interpreter:
  1. Git Hygiene:

Overview Part 1: The Core Language (Ch 2-5)

Goal: Roadmap for the week. Easing into Python from your JavaScript background.

Chapter 2: Data Types (Variables)

Key Topics*:

Variables*: Labels for objects, dynamic typing.

Strings*: F-strings (f"Hello {name}") vs concatenation.

Mutability*: The difference between list (mutable) and str/tuple (immutable).

JS vs Python*:

Chapter 3: Control Flow

Key Topics*:

Conditionals*: if, elif, else.

Loops*: for item in iterable (foreach style) vs while.

Truthiness*: Explicit checks vs implicit (empty list [] is False).

JS vs Python*:

Chapter 4: Functions

Key Topics*:

Definition*: def, parameters, return values.

Arguments*: Positional vs Keyword arguments (func(a=1)).

Entry Point*: The if __name__ == "__main__": idiom.

JS vs Python*:

Chapter 5: Type Hints

Key Topics*:

Syntax*: variable: type and -> return_type.

Complex Types*: list[str], dict[str, int], Optional[int].

Static Analysis*: How tools like mypy (or VS Code) use hints.

JS vs Python*: