import streamlit as st

st.title('BMI Calculator')

height = st.number_input('Enter your height (in cm)') weight = st.number_input('Enter your weight (in kg)')

if st.button('Calculate BMI'): bmi = weight / ((height/100)**2) st.write('Your BMI is:', round(bmi, 2))

if bmi < 18.5:
    st.write('You are underweight')
elif bmi >= 18.5 and bmi < 24.9:
    st.write('You are normal weight')
elif bmi >= 24.9 and bmi < 29.9:
    st.write('You are overweight')
else:
    st.write('You are obese')
BMI Calculator - Calculate Your Body Mass Index

原文地址: https://www.cveoy.top/t/topic/g7WG 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录