I'm new to Python and I'm trying to create a BMI calculator.
I don't know how to make it to show the result with 2 decimals (21.64
for example).
Here is my code:
taille = float(input("Enter votre taille en mètre: "))
poids = float(input("Enter votre poids en kg: "))
bmi = (poids/(taille**2))
print ('Votre IMC est', bmi, 'et vous êtes :')
if ( bmi < 16):
print("maigre, veuillez consulter un spécialiste !")
elif ( bmi >= 16 and bmi < 18.5):
print(" sous le seuil normal,Faites du sport et manger sainement !")
elif ( bmi >= 18.5 and bmi < 25):
print("en bonne santé, continuez comme ça!")
elif ( bmi >= 25 and bmi < 30):
print("en surpoids, faites un peu plus de sport !")
elif ( bmi >=30):
print("sévèrement en surpoids, faites du sport et manger sainement")