Skip to main content

Practice · 3 of 4

Raise on Bad Input

CHALLENGE
Difficulty: beginner+25 XP

Write set_age(age) that returns age when it is 0..150 and raises ValueError with a message mentioning the number otherwise. The tests pass 200 and expect the raise.

Back to lesson: Practice: Traceback Reading