Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #Python program to calculat the BMI given the input weight in kgs and height in meters
- #take weight as input and convert to float
- weight_in_kg = input("Enter your weight in kgs:")
- weight_in_kg = float(weight_in_kg)
- #take input and convert to number (float) in one single step
- height_in_meters = float(input("Enter you height in meters:"))
- #calculate bmi as per the formula given and the algorithm above
- bmi = weight_in_kg / (height_in_meters ** 2)
- #Display bmi
- print("Your BMI is :", bmi)
Advertisement
Add Comment
Please, Sign In to add comment