Enhance your Knowledge | Flat 25% Discount on all Courses | Use Coupon Code - ENHANCE25 During Checkout |

 Enroll Now

Python Introduction (Hands-on)

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)

  • Define a variable height with value 1.7
  • Define a variable weight with value 72.25
  • Define a variable bmi and assign the calculated integer value of BMI to this variable
  • Print bmi using print(bmi). You should get 25