Spaces:
Running
on
Zero
Running
on
Zero
da03
commited on
Commit
·
2b1b4f1
1
Parent(s):
deed971
app.py
CHANGED
|
@@ -39,8 +39,12 @@ def predict_product(num1, num2):
|
|
| 39 |
except ValueError:
|
| 40 |
valid_input = False
|
| 41 |
if valid_input:
|
| 42 |
-
correct_product =
|
| 43 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 44 |
result_color = "green" if is_correct else "red"
|
| 45 |
result_message = "Correct!" if is_correct else f"Incorrect! The correct product is {correct_product}."
|
| 46 |
else:
|
|
|
|
| 39 |
except ValueError:
|
| 40 |
valid_input = False
|
| 41 |
if valid_input:
|
| 42 |
+
correct_product = num1_int * num2_int
|
| 43 |
+
try:
|
| 44 |
+
prediction = int(prediction)
|
| 45 |
+
is_correct = (prediction == correct_product)
|
| 46 |
+
except ValueError:
|
| 47 |
+
is_correct = False
|
| 48 |
result_color = "green" if is_correct else "red"
|
| 49 |
result_message = "Correct!" if is_correct else f"Incorrect! The correct product is {correct_product}."
|
| 50 |
else:
|