|
import streamlit as st
|
|
|
|
|
|
st.markdown("""
|
|
<style>
|
|
body {
|
|
background-color: green;
|
|
}
|
|
.stButton > button {
|
|
background-color: #4CAF50; /* Vert bouton */
|
|
color: white;
|
|
font-size: 16px;
|
|
border-radius: 10px;
|
|
}
|
|
</style>
|
|
""", unsafe_allow_html=True)
|
|
|
|
|
|
st.title("Calculateur d'IMC")
|
|
|
|
|
|
poids = st.number_input("Entrez votre poids (kg):", min_value=1.0, format="%.2f")
|
|
poids2 = st.number_input("Entrez votre poids a la dernière consultation(kg):", min_value=1.0, format="%.2f")
|
|
AG1=st.number_input("Entrez Age première consultation:", min_value=1.0, format="%.2f")
|
|
AG2=st.number_input("Entrez Age seconde consultation:", min_value=1.0, format="%.2f")
|
|
taille = st.number_input("Entrez votre taille (m):", min_value=0.5, format="%.2f")
|
|
|
|
|
|
if st.button("Calculer l'IMC"):
|
|
if taille > 0:
|
|
imc = poids / (taille ** 2)
|
|
var=(poids-poids2)/(AG2-AG1)
|
|
st.success(f"Votre IMC est de : {imc:.2f}")
|
|
st.success(f"Votre VAR est de : {var:.2f}")
|
|
|
|
if imc < 18.5:
|
|
st.info("Vous êtes en insuffisance pondérale.")
|
|
elif 18.5 <= imc < 24.9:
|
|
st.success("Votre poids est normal.")
|
|
elif 25 <= imc < 29.9:
|
|
st.warning("Vous êtes en surpoids.")
|
|
else:
|
|
st.error("Vous êtes en obésité.")
|
|
else:
|
|
st.error("Veuillez entrer une taille valide.")
|
|
|