Skip to main content

Practice · 2 of 3

Validate a Requirements File

CHALLENGE
Difficulty: beginner+25 XP

Write parse_requirements(text) returning a dict of package -> version from a requirements-style string. Ignore blank lines and comments (# ...). Raise ValueError on any line without a version pin.

Back to lesson: Practice: Requirements Hygiene