LearnPy Hub
← Exceptions problems
Hard

Log and Re-raise

Write parse(s) that calls int(s); on ValueError it prints log: bad value S and re-raises. The main code catches the re-raised error and prints handled. For valid input print the number.

Input

One line.

Output

One or two lines.

Sample 1

Input
12
Output
12

Sample 2

Input
twelve
Output
log: bad value twelve
handled
solution.py
Output appears here
Log and Re-raise · Python practice problem · LearnPy Hub