import gradio as gr def calculator(operation, a, b): if operation == 'Add': return a + b elif operation == 'Subtract': return a - b elif operation == 'Multiply': return a * b elif operation == 'Divide': return a / b if b != 0 else 'Error: Division by zero' # Create the Gradio interface with the correct inputs for the radio buttons iface = gr.Interface( fn=calculator, inputs=[ gr.Radio(choices=['Add', 'Subtract', 'Multiply', 'Divide'], label="Operation"), gr.Number(label="a"), gr.Number(label="b") ], outputs=gr.Textbox(label="The result is:"), title="Simple Calculator", description="Select an operation and enter two numbers to perform basic arithmetic." ) # Launch the app iface.launch()