modules, imports, and why your venv hates you9 / 9
aliases, multi-imports, and the `np.` you'll see everywhere
Checkpoint
One last thing before we move on. Same surface as a write step — but the lesson doesn't complete until this passes.
Last one. Cursor wrote a one-page script that's supposed to print today's
year using datetime, but the imports are wrong. Three things to fix:
- The first line uses
import datetime as dtbut then later callsdatetime.now()directly — those don't match. - The second line
from datetime import *is the antipattern. Replace it with a targetedfrom datetime import datetime. - After fixing the first two, the third line works on its own — but
remove the redundant first line entirely. You only need one of the two
ways to reach
datetime.now().
After the fix, the script should print the current year (a 4-digit number).
We'll grade by checking the output is 2026 (matches the current year).
⌘↵ runs the editor.
Booting Python…
Output
[promptdojo:~]$ _