15 lines
414 B
Python
15 lines
414 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(n):
|
|
while True:
|
|
try:
|
|
numb = float(input(n))
|
|
except ValueError:
|
|
print(f"{numb} is not a number")
|
|
|
|
|
|
x = numb_check(input('Enter a number: '))
|
|
y = numb_check(input('Enter another number: '))
|
|
product = x * y
|
|
print(product) |