BMI_Calculator / app.py
Avatansh Malaviya
Initial BMI Calculator
333ce44
raw
history blame contribute delete
768 Bytes
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()