Coding exercise tips, shortcuts, and accessibility
Get the most out of the exercise workspace with these shortcuts and features.
Keyboard shortcuts
| Shortcut | Action |
|---|---|
| Ctrl+Enter / Cmd+Enter | Run tests (while in the editor) |
| t | Toggle full-width mode (while not typing in the editor) |
| Esc | Leave the editor; press again to exit full-width mode |
| Tab | Indent code in the editor |
| Ctrl+Z / Cmd+Z | Undo in the editor |
| Ctrl+Shift+Z / Cmd+Shift+Z | Redo in the editor |
Because Tab indents code, it won't move focus out of the editor. Press Esc first, then Tab, to continue navigating the page by keyboard.
Full-width mode
Click the expand button in the exercise header (or press t) to grow the workspace to your whole browser window. This is especially handy for exercises with longer instructions or more code. Press Esc or the button again to shrink back.
Editor features
The code editor is intentionally minimal, closer to an exam bluebook than a full IDE:
- Python syntax highlighting, line numbers, and bracket matching
- Full undo/redo history
- Automatic indentation with 4 spaces
- Double-click a
...placeholder to select the whole thing and type over it
There's no autocomplete on purpose: typing code out yourself is part of the practice.
Working through exercises effectively
- Run early, run often. Runs are unlimited and each one saves your code. Use failing tests as a to-do list.
- Fix the first failure first. Tests often build on each other, and the first failure auto-expands for exactly this reason.
- Read test names before coding. The sidebar lists what will be checked, which tells you a lot about the requirements.
- After passing, compare with our solution. Passing is step one; seeing an idiomatic alternative is where a lot of the learning happens.
Accessibility
The exercise workspace is built to work well with keyboards and screen readers:
- All tabs, hints, and test results are keyboard operable (Enter or Space activates the focused element, arrow keys move between tabs).
- Test progress and results are announced via live regions as they arrive.
- Pass/fail states are conveyed with text and icons, not color alone.
If you hit an accessibility issue in an exercise, please let us know through the feedback link on the exercise or via support: we want to fix it.