diff --git a/lab-02/problem-04.py b/lab-02/problem-04.py index 06b6271..672cb04 100644 --- a/lab-02/problem-04.py +++ b/lab-02/problem-04.py @@ -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: ")) \ No newline at end of file