11 lines
350 B
Python
11 lines
350 B
Python
# Write a Python program that prompts the user to input two numbers and raises a TypeError exception if the inputs are
|
|
# not numerical.
|
|
|
|
def numb_check(x, y):
|
|
try:
|
|
result = x * y
|
|
except TypeError:
|
|
print(f"Either {x} and/or {y} are not numbers.")
|
|
|
|
|
|
numb_check(x = input("Enter a number: "), y = input("Enter another number: ")) |