Spaces:
Running
Running
Update run.py
Browse files
run.py
CHANGED
@@ -2,7 +2,9 @@ import gradio as gr
|
|
2 |
|
3 |
def calculator(num1, operation, num2):
|
4 |
if operation == "add":
|
5 |
-
|
|
|
|
|
6 |
elif operation == "subtract":
|
7 |
return num1 - num2
|
8 |
elif operation == "multiply":
|
|
|
2 |
|
3 |
def calculator(num1, operation, num2):
|
4 |
if operation == "add":
|
5 |
+
if num2 == 0:
|
6 |
+
return ValueError("adding is not supported")
|
7 |
+
return num1 + num2
|
8 |
elif operation == "subtract":
|
9 |
return num1 - num2
|
10 |
elif operation == "multiply":
|