// resources
Resources
All
|
Cheatsheet
Code Example
Exercise
Template
Other
Achievement
|
Basics
Control Flow
Functions
Data Structures
Modules & Packages
Projects
Object-oriented programming
|
↑ oldest first
↓ newest first
// Code Example
utils.py
Your first custom module. Three functions, one guard. Place it in the same folder as main.py and import away.
// Code Example
main.py
Imports from utils.py — both patterns side by side. Run this after utils.py is in the same folder.
// Exercise
squad_utils.py
The shared module. Three functions — format_name, is_active, squad_summary. Written once, imported by everything else.
// Exercise
briefing.py
Imports format_name and is_active from squad_utils. Prints a clean roster with status for each member.
// Exercise
report.py
Imports squad_summary from squad_utils. Prints total, active, and inactive count in three lines.
// Cheatsheet
Modules — The Full Picture
Everything you've learned about modules — in one place. random, math, datetime, statistics, time, collections, string, …
// Exercise
calories_tracker_r3.py
Calories Tracker — Round 3. Complete working file: add food with validation, filter last 7 days, display results. First…
// Exercise
calories_tracker_r4.py
Calories Tracker — Round 4. Discipline analysis added: daily calorie sums, personal target comparison, sorted output. T…