LearnPy Hub
← Context Managers problems
Medium

Count and Ignore Errors

Write class Ignore that suppresses ValueError (return True from __exit__) and counts how many it swallowed in a class attribute. For each input token, inside with Ignore():, print int(token) * 10. Finally print the count.

Input

One line of tokens.

Output

Lines.

Sample 1

Input
1 x 3
Output
10
30
1

Sample 2

Input
a b
Output
2
solution.py
Output appears here
Count and Ignore Errors · Python practice problem · LearnPy Hub