Skip to main content

Practice ยท 2 of 2

Success Path in else

Refactor: keep the try block containing ONLY the risky conversion, move the success print into else, and keep the error print in except. Output must stay identical for both a valid and an invalid value.

Difficulty: beginner

Back to lesson: Practice: else/finally & Fail-Fast Drills