Articles
The problem...
You need a random number. You need today's date. You need the square root of something.
You could write the code yourself. But someone already did — and did…
The idea
You've already seen datetime in action — the Daily Notes project used it to timestamp every entry.
Now let's look at what it can actually do.
Importing datetime
…
The idea
You have a list of numbers. Scores, prices, temperatures, times.
Raw numbers tell you something. But averages, medians, and spreads tell you more.
Python's statistics …
The idea
datetime tells you what time it is. time tells you how long something takes — and lets you control when your program runs.
Two functions. That's most of what you'…
The idea
You know dicts. You know how to build them, read them, modify them.
The collections module has two tools that extend what dicts can do — and eliminate two pattern…
The idea
You need all lowercase letters. Or all digits. Or every punctuation character.
You could type them manually. Or you could let Python hand them to you.
The constants
i…