how to make bmi calculator in python

Solutions on MaxInterview for how to make bmi calculator in python by the best coders in the world

showing results for - "how to make bmi calculator in python"
Pascal
26 Nov 2020
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')
Philippe
02 Aug 2018
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
bmi python programmingbmi calculator in python using defbmi formula for pythonpython basic bmi in kilograms python bmi codepython calculator codehow to calculate bmi from weight and height in python pandaspython bmi calculator codepython calculator programhow to create bmi calculator in pythonpython bmibmi calculator python codeprogram to calculate bmi pythoncoding calculate bmi pythonhow to build a bmi calculator in pythonhow to caculate a bmi in pythonbmi python site 3amedium com site 3atowardsdatascience combmi calculator program code in pythoncalculate bmi python codesimple bmi calculator using pythonwrite a program that calculates and displays a person 27s body mass index pythonbmi calculator using pythondesign a body mass index 28bmi 29 program using python code bmi formula pythonwrite a python program to calculate body mass index for a person hint 3a weight 2f 28height 2a height 29def bmi calculator pythonbmi calculator code in pythonsimple bmi calculator pythonbmi calculation in pythonb m i calculator in python python program for bmi calculatorbmi simple calculator code pythonbmi calculator in pythonhow to make bmi calculator in pythonbmi in pythontaking the input for calculating bmi python how to calculate bmi pythonhow to calculate bmi using phyotonwrite a python program to calculate body mass index for a person hunt 3a weight 2f 28height 2a height 29bmi python bmi calculator pythonbody mass index calculator pythoncalculate bmi pythonbmi calculator in python using inputbmi calculator python sololearncalculation for bmi in pythonpython bmi calculator using functionsbmi simple calculator code python html codebmi calculator function pythonsimple bmi calculator in pythonbmi calculator program in python bmi in pythoncode for bmi calculator pythonpython program for bmi calculationhow to calculate bmi from weight and height in pythonthonny letter weight calculatorbmi python codebmi calculator module pythonhow to calculator bmi in python codepython calculate bmihow to make a bmi calculator in pythonbmi calculator using python simplebmi calculator pythoncalculator python codehow to create a bmi calculator in pythonwrite a program to find bmi of the patients using pythonbmi calculator function in pythonhow to calculate bmi in pythonweight calculator in kg python scriptsbmi 3d height 2fweight to the power of 2 on pythoncalculate bmi in pythonimport bmi pythonpython bmi calculatorbmi calculator python example cpdepython program for weight and heighthow to make bmi calculator in python