python bmi calculator code

Solutions on MaxInterview for python bmi calculator code by the best coders in the world

showing results for - "python bmi calculator code"
Mads
21 Jun 2018
1weight = float(input('What is your weight? (Kg) '))
2height = float(input('What is your height? (Mtr) '))
3bmi = weight/(height*height)
4
5if bmi <= 18.5:
6    print('Your BMI is', bmi, 'which means you are underweight')
7
8elif 18.5 < bmi < 25:
9    print('Your BMI is', bmi,'which means you are normal')
10
11elif 25 < bmi < 30:
12    print('your BMI is', bmi,' which means you are overweight')
13
14elif bmi > 30:
15    print('Your BMI is', bmi,'which means you are obese')
Amelie
29 Sep 2019
1print("Welcome to BMI calculator, by Abthahi Tazrian.")
2
3# Offer Measurement Conversions
4
5Offer_Conversions = input("Would you like to convert your imperial units to metric? (yes / no): ")
6
7if Offer_Conversions == "yes":
8    Imperial_Weight = input("What is your weight in pounds?: ")
9    Imperial_Height = input("What is your height in feet (decimals)?: ")
10
11    Imperial_Weight = float(Imperial_Weight)
12    Imperial_Height = float(Imperial_Height)
13
14    Metric_Converted_Weight = Imperial_Weight * 2.205
15    Metric_Converted_Height = Imperial_Height * 30.48
16
17    Metric_Converted_Weight = str(Metric_Converted_Weight)
18    Metric_Converted_Height = str(Metric_Converted_Height)
19
20    print("Your metric weight is " + Metric_Converted_Weight + " kg, please note this for the next stage.")
21    print("Your metric height is " + Metric_Converted_Height + " cm, please note this for the next stage.")
22    print("--")
23elif Offer_Conversions == "no":
24    print("--")
25
26# Data Collection
27
28Age = input("Put in your age: ")
29Weight = input("Put in your weight in KG: ")
30Height = input("Put in your height in CM: ")
31
32# BMI Formula Calculation
33
34Weight = float(Weight)
35Height = float(Height)
36
37Height_Squared = Height * Height
38BMI_Formula_Assisted = Weight / Height_Squared
39BMI_Formula_Completed = BMI_Formula_Assisted * 10000
40
41# Health Chart Display
42
43BMI_Formula_Completed = str(BMI_Formula_Completed)
44
45print("You have a BMI score of " + BMI_Formula_Completed + ".")
46
47BMI_Formula_Completed = float(BMI_Formula_Completed)
48
49if BMI_Formula_Completed <= 18.5:
50    print("You are underweight, consider gaining weight to bring your BMI to between 20 and 25.")
51elif BMI_Formula_Completed <= 25:
52    print("You are perfectly healthy, with a BMI within a healthy range of between 20 and 25.")
53elif BMI_Formula_Completed <= 30:
54    print("You are overweight, speak to a doctor about setting yourself a new target BMI between 20 and 25.")
55elif BMI_Formula_Completed >= 30.1:
56    print("You are obese, you need to lower your BMI to between 20 and 25 or else you may be at risks.")
queries leading to this page
calculate bmi in pythonbmi python programmingbmi target calculator pythonimport bmi pythonbmi python codebmi in pythonpython program for bmi calculatorcalculator python codebmi calculation pythonbmi calculation in python bmi in pythonhow to calculate bmi from weight and height in python pandascalculation for bmi in pythonhow to calculate bmi pythonhow to calculate bmi using phyotonwrite a python program to calculate body mass index for a person hint 3a weight 2f 28height 2a height 29taking the input for calculating bmi python python calculate bmipython program for bmi calculator using functionsbmi calculator program in pythoncalculate bmi pythonb m i calculator in python write a python program to calculate body mass index for a person hunt 3a weight 2f 28height 2a height 29how to create bmi calculator in pythonweight calculator in kg python scriptshow to caculate a bmi in pythonpython bmi calculatorcoding calculate bmi python bmi calculator pythonbmi calculator function in pythonpython program for weight and heightdef bmi calculator pythonprogram to calculate bmi pythonbmi simple calculator code python html codepython program for bmi calculationhow to make bmi calculator in pythonhow to calculate bmi from weight and height in pythondesign a body mass index 28bmi 29 program using python code bmi calculator program code in pythonbmi calculator function pythoncode for bmi calcuator pythonsimple bmi calculator pythonpython basic bmi in kilograms bmi pythonbmi 3d height 2fweight to the power of 2 on pythonbmi python site 3amedium com site 3atowardsdatascience combmi simple calculator code pythonbmi formula for pythonwrite a program to find bmi of the patients using pythonsimple bmi calculator in pythonhow to build a bmi calculator in pythonbmi calculator python sololearnbmi calculator using python simplepython bmi codepython calculator programpython bmi calculator using functionspython calculator codecalculate bmi python codehow to create a bmi calculator in pythonbody mass index calculator pythonbmi calculator code in pythonthonny letter weight calculatorhow to calculate bmi in pythonbmi formula pythonpython program for bmi calculator using class and objectbmi calculator module pythonbmi calculator using pythonhow to calculator bmi in python codebmi calcultor python code how to calculate bmi in pyhtonhow to make a bmi calculator in pythonbmi calculator python codebmi calculator in pythonmbmi calculator in python using inputcode for bmi calculator pythonbmi calculator in pythonwrite a program that calculates and displays a person 27s body mass index pythonbmi calculator pythonpython bmi calculator codesimple bmi calculator using pythonbmi calculator in python using defpython bmibmi calculator python example cpdepython bmi calculator code