Update app.py
Browse files
app.py
CHANGED
@@ -16,14 +16,13 @@ def calculator(num1, operation, num2=None):
|
|
16 |
return num1 * num1 * num1
|
17 |
elif operation == "exponential":
|
18 |
return math.pow(num1, num2)
|
19 |
-
|
20 |
-
return math.sqrt(num1)
|
21 |
|
22 |
demo = gr.Interface(
|
23 |
fn=calculator,
|
24 |
inputs=[
|
25 |
gr.Number(value=4),
|
26 |
-
gr.Radio(["add", "subtract", "multiply", "divide", "square", "cube", "exponential"
|
27 |
gr.Number(value=2, label="Second Number (optional)", optional=True)
|
28 |
],
|
29 |
outputs="number",
|
@@ -33,13 +32,7 @@ demo = gr.Interface(
|
|
33 |
[-4, "multiply", 2.5],
|
34 |
[0, "subtract", 1.2],
|
35 |
[2, "exponential", 3],
|
36 |
-
|
37 |
-
[2.3, "cos"],
|
38 |
-
[0.8, "tan"],
|
39 |
-
[9, "sqrt"],
|
40 |
-
[1.2, "sinh"],
|
41 |
-
[2.1, "cosh"],
|
42 |
-
[0.7, "tanh"]
|
43 |
],
|
44 |
title="Scientific Calculator",
|
45 |
description="Here's a sample scientific calculator. Enjoy! Code by: Freddy Aboulton Improved by: Usually3"
|
|
|
16 |
return num1 * num1 * num1
|
17 |
elif operation == "exponential":
|
18 |
return math.pow(num1, num2)
|
19 |
+
|
|
|
20 |
|
21 |
demo = gr.Interface(
|
22 |
fn=calculator,
|
23 |
inputs=[
|
24 |
gr.Number(value=4),
|
25 |
+
gr.Radio(["add", "subtract", "multiply", "divide", "square", "cube", "exponential"]),
|
26 |
gr.Number(value=2, label="Second Number (optional)", optional=True)
|
27 |
],
|
28 |
outputs="number",
|
|
|
32 |
[-4, "multiply", 2.5],
|
33 |
[0, "subtract", 1.2],
|
34 |
[2, "exponential", 3],
|
35 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
36 |
],
|
37 |
title="Scientific Calculator",
|
38 |
description="Here's a sample scientific calculator. Enjoy! Code by: Freddy Aboulton Improved by: Usually3"
|