Practice · 2 of 2
Success Path in else
CHALLENGE
Difficulty: beginner+25 XP
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.
Press Submit to check your solution.
Back to lesson: Practice: else/finally & Fail-Fast Drills