nah0m commited on
Commit
40197de
1 Parent(s): 1d5fb73

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -5
app.py CHANGED
@@ -1,13 +1,13 @@
1
  import gradio as gr
2
 
3
  def calculator(num1, operation, num2):
4
- if operation == "add":
5
  return num1 + num2
6
- elif operation == "subtract":
7
  return num1 - num2
8
- elif operation == "multiply":
9
  return num1 * num2
10
- elif operation == "divide":
11
  return num1 / num2
12
 
13
 
@@ -15,7 +15,7 @@ demo = gr.Interface(
15
  fn=calculator,
16
  inputs=[
17
  gr.Number(value=4),
18
- gr.Radio(["add", "subtract", "multiply", "divide"]),
19
  "number"
20
  ],
21
  outputs="number",
 
1
  import gradio as gr
2
 
3
  def calculator(num1, operation, num2):
4
+ if operation == "+":
5
  return num1 + num2
6
+ elif operation == "-":
7
  return num1 - num2
8
+ elif operation == "*":
9
  return num1 * num2
10
+ elif operation == "/":
11
  return num1 / num2
12
 
13
 
 
15
  fn=calculator,
16
  inputs=[
17
  gr.Number(value=4),
18
+ gr.Radio(["+", "-", "*", "/"]),
19
  "number"
20
  ],
21
  outputs="number",