Skip to main content

Practice ยท 3 of 4

Raise on Bad Input

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.

Difficulty: beginner

Back to lesson: Practice: Traceback Reading