// 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
module_time.py
time — sleep, time(), perf_counter. Pause execution, measure elapsed time, and build a countdown. Two functions that co…
// Code Example
module_collections.py
Counter and defaultdict — two tools that eliminate boilerplate. Count occurrences in one line, group items without chec…
// Code Example
module_string.py
Built-in string constants — ascii_letters, digits, punctuation. Check membership, generate passwords, validate input, s…
// 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.