Python-Intro/bmi.py
2019-03-24 21:04:45 +01:00

12 lines
356 B
Python

# Calculate your Body-Mass-Index with Python
print("BMI - Calculator!")
weight_str = input("Please insert your weight (in kg): ")
height_str = input("Please insert your bodys height(in m): ")
weight = float(weight_str.replace(",", "."))
height = float(height_str.replace(",", "."))
bmi = weight / height ** 2
print("Your BMI is: " + str(round(bmi, 1)))