LearnPy Hub
← Exceptions problems
Medium

Which Errors Happened?

Read lines of Python expressions until END. Evaluate each with eval; print the result, or the name of the exception it raised.

Input

Lines, then END.

Output

Lines.

Sample 1

Input
1 / 0
[1, 2][5]
int('x')
2 + 3
END
Output
ZeroDivisionError
IndexError
ValueError
5

Sample 2

Input
{}['k']
END
Output
KeyError
solution.py
Output appears here
Which Errors Happened? · Python practice problem · LearnPy Hub