tauk

Untitled

Jun 7th, 2020
1,001
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.58 KB | None | 0 0
  1. #Python program to calculat the BMI given the input weight in kgs and height in meters
  2.  
  3. #take weight as input and convert to float
  4. weight_in_kg = input("Enter your weight in kgs:")
  5. weight_in_kg = float(weight_in_kg)
  6.  
  7. #take input and convert to number (float) in one single step
  8. height_in_meters = float(input("Enter you height in meters:"))
  9.  
  10. #calculate bmi as per the formula given and the algorithm above
  11. bmi = weight_in_kg / (height_in_meters ** 2)
  12.  
  13. #Display bmi
  14. print("Your BMI is :", bmi)
Advertisement
Add Comment
Please, Sign In to add comment