Spaces:
Sleeping
Sleeping
| import gradio as gr | |
| def calculate_bmi(weight, height): | |
| bmi = weight / (height ** 2) | |
| return f"Your BMI is: {bmi:.2f}" | |
| iface = gr.Interface( | |
| fn=calculate_bmi, | |
| inputs=[gr.Number(label="Weight (kg)"), gr.Number(label="Height (m)")], | |
| outputs="text", | |
| title="BMI Calculator", | |
| description="Enter your weight in kilograms and height in meters." | |
| ) | |
| iface.launch() | |
| import gradio as gr | |
| def calculate_bmi(weight, height): | |
| bmi = weight / (height ** 2) | |
| return f"Your BMI is: {bmi:.2f}" | |
| iface = gr.Interface( | |
| fn=calculate_bmi, | |
| inputs=[gr.Number(label="Weight (kg)"), gr.Number(label="Height (m)")], | |
| outputs="text", | |
| title="BMI Calculator", | |
| description="Enter your weight in kilograms and height in meters." | |
| ) | |
| iface.launch() | |