Spaces:
Runtime error
Runtime error
| """ | |
| Evaluate the expression ax² + bx + c for a given value of x. | |
| """ | |
| import gradio as gr | |
| def evaluate_quadratic_expression(a, b, c, x): | |
| return a * (x ** 2) + b * x + c | |
| evaluate_expression_interface = gr.Interface( | |
| fn=evaluate_quadratic_expression, | |
| inputs=[ | |
| gr.Number(label="a (coefficient of x²)"), | |
| gr.Number(label="b (coefficient of x)"), | |
| gr.Number(label="c (constant)"), | |
| gr.Number(label="x (value)") | |
| ], | |
| outputs="number", | |
| title="Quadratic Expression Evaluator", | |
| description="Evaluate ax² + bx + c for a given value of x" | |
| ) | |
| if __name__ == "__main__": | |
| evaluate_expression_interface.launch() | |