Part 1 · Section 11

Extras

This section collects small but useful techniques that don’t fit neatly anywhere else. Each one is something you will reach for in real programs: making randomness repeatable so bugs can be reproduced, measuring how fast a snippet runs, reading arguments from the command line, and writing functions whose parameters say exactly what they mean.

In this section you’ll learn:

Lectures

  1. 09Random Seeds✓
  2. 10Random Choices✓
  3. 11Random Samples✓
  4. 12Timing code using timeit✓
  5. 13Don't Use args and kwargs Names Blindly✓
  6. 14Command Line Arguments✓
  7. 15Sentinel Values for Parameter Defaults✓
  8. 16Simulating a simple Switch in Python✓

Practice: quiz & exercises

12 quiz questions · 3 coding exercises

Go to practice →