Python-Intro/bmi.py

12 lines
356 B
Python
Raw Normal View History

2019-03-24 20:04:45 +00:00
# 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)))