feat(problem-04.py): an attempt at solving.

This commit is contained in:
baphim
2026-09-12 21:52:51 -04:00
parent 7389bf4f7b
commit 6e218f326b
+3 -8
View File
@@ -3,14 +3,9 @@
def numb_check(x, y):
try:
# Try if both values entered are numbers
x == float(x)
y == float(y)
# Print a confirmation message
print(f"Correct. Both {x} and {y} are numbers.")
result = x * y
except TypeError:
# Print message stating one or both values entered are not numbers
print(f"Either {x} and/or {y} is not a number.")
print(f"Either {x} and/or {y} are not numbers.")
# Call the numb_check function and prompt user for input
numb_check(x = input("Enter a number: "), y = input("Enter another number: "))