Introduction to Programming using Python 1st Edition

Published by Pearson
ISBN 10: 0132747189
ISBN 13: 978-0-13274-718-9

Chapter 2 - Elementary Programming - Programming Exercises - Page 59: 2.17

Answer

Enter your weight in pounds: 95.5 Enter your height is inches: 50 Your BMI is: 26.8573

Work Step by Step

We can write the program to calculate BMI as follows: 1. weight=eval(input("Enter your weight in pounds: ")) 2. height=eval(input("Enter your height in inches: ")) 3. weight*=0.45359237 4. height*=0.0254 5. BMI=weight/height**2 6. print ("Your BMI is: ", BMI) The user is asked to enter his weight and height in pounds and inches respectively. The weight is converted to kilograms and the height is converted into meters. Then, the BMI is calculated and the result is displayed.
Update this answer!

You can help us out by revising, improving and updating this answer.

Update this answer

After you claim an answer you’ll have 24 hours to send in a draft. An editor will review the submission and either publish your submission or provide feedback.