LearnPy Hub
← Exceptions problems
Medium

Raise a TypeError

Write area(w, h) that raises TypeError('numbers only') unless both are int or float, and otherwise returns w × h. Read two values: convert each to int if it is all digits, otherwise keep it as text. Print the area or the error message.

Input

Two lines.

Output

One line.

Sample 1

Input
3
4
Output
12

Sample 2

Input
3
four
Output
numbers only
solution.py
Output appears here
Raise a TypeError · Python practice problem · LearnPy Hub