Advertisement
Guest User

BMI

a guest
Mar 6th, 2012
234
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.30 KB | None | 0 0
  1. #!/usr/bin/python
  2. # written by pratham
  3.  
  4. def calcBMI( h, w ):
  5.     BMI = w / h**2
  6.     return BMI
  7.  
  8. def main():
  9.     height = float(raw_input("Enter height in metres: "))
  10.     weight = float(raw_input("Enter weight in kilos: "))
  11.     BMI = calcBMI(height, weight)
  12.     print "BMI = %0.1f" % BMI
  13.  
  14. main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement