Six lessons covered files (open, read, write, with), exceptions (try/except, specific types), and comprehensions with filters. Eight questions, 80% to pass.
Let's go.
| Lesson | Concept | Key syntax |
|---|---|---|
| 1 | open() and read() | open(path), f.read(), f.close() |
| 2 | Writing files | open(path, "w"), f.write(...), truncate vs append |
| 3 | with statement | with open(...) as f: — auto-close |
| 4 | try / except basics | catch a named exception, keep running |
| 5 | Specific exceptions | KeyError, ValueError, FileNotFoundError, … |
| 6 | Comprehensions with filter | [expr for x in xs if cond] |
Week 2 deepens functions and dicts.
Create a free account to get started. Paid plans unlock all tracks.
Six lessons covered files (open, read, write, with), exceptions (try/except, specific types), and comprehensions with filters. Eight questions, 80% to pass.
Let's go.
| Lesson | Concept | Key syntax |
|---|---|---|
| 1 | open() and read() | open(path), f.read(), f.close() |
| 2 | Writing files | open(path, "w"), f.write(...), truncate vs append |
| 3 | with statement | with open(...) as f: — auto-close |
| 4 | try / except basics | catch a named exception, keep running |
| 5 | Specific exceptions | KeyError, ValueError, FileNotFoundError, … |
| 6 | Comprehensions with filter | [expr for x in xs if cond] |
Week 2 deepens functions and dicts.