Python Foundations - Assessments

8 / 54

Hands-on on Python Variables

Now we know the operations and variables in Python. Let's write a program to calculate the BMI.

BMI = weight / (height * height)

Here weight is in kg (kilogram) and height is in mt (meters)

INSTRUCTIONS
  • Define a variable height with value 1.7
  • Define a variable weight with value 72.25
  • Define a variable bmi and calculate the value of BMI using the above formula.
  • Convert bmi into int type.
  • Then print bmi using print(bmi). You should get 25 not 25.0.


Note - Having trouble with the assessment engine? Follow the steps listed here

Loading comments...