Diegofergamboa / day-2-2-exercise

#Python_challenge = Creating a BMI calculator

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

BMI Calculator

Instructions

Write a program that calculates the Body Mass Index (BMI) from a user's weight and height.

The BMI is a measure of some's weight taking into account their height. e.g. If a tall person and a short person both weigh the same amount, the short person is usually more overweight.

The BMI is calculated by dividing a person's weight (in kg) by the square of their height (in m):

Warning you should convert the result to a whole number.

Example Input

weight = 80
height = 1.75

Example Output

80 ÷ (1.75 x 1.75) = 26.122448979591837

26

e.g. When you hit run, this is what should happen:

Hint

  1. Check the data type of the inputs.
  2. Try to use the exponent operator in your code.
  3. Remember PEMDAS.
  4. Remember to convert your result to a whole number (int).

Test Your Code

Before checking the solution, try copy-pasting your code into this repl:

https://repl.it/@appbrewery/day-2-2-test-your-code

This repl includes my testing code that will check if your code meets this assignment's objectives.

Solution

https://repl.it/@appbrewery/day-2-2-solution

About

#Python_challenge = Creating a BMI calculator


Languages

Language:Python 100.0%