Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

bmi python

weight = float(input("Enter weight (in kg): "))
height = float(input("Enter height (in m): "))

bmi = weight / (height * height) # formula
value = "" # value of bmi

if bmi < 18.5:
    value = "underweight"
elif 18.5 < bmi < 25:
    value = "normal weight"
elif 25 < bmi < 30:
    value = "overweight"
elif 30 < bmi < 35:
    value = "obese"
elif bmi > 35:
    value = "clinically obese"

print(f"You are {value}.")
Comment

py bmi

#simple BMI calculator
x = int(input("Enter Weight: "))
y = float(input("Enter Height: "))
z = x/y**2
if z<18.5:
    print("Underweight")
elif z==18.5 or z<25:
    print("Normal")
elif z==25 or z<30:
    print("Overweight")
else:
    print("Obesity")
Comment

PREVIOUS NEXT
Code Example
Python :: write csv python pandas stack overflow 
Python :: display flask across network 
Python :: How to to efficiently find the first index in a sorted array of distinct numbers that is equal to the value at that index? 
Python :: pearson corr 
Python :: binning data dataframe, faire classe statistique dataframe 
Python :: who is elcharitas 
Python :: how to python hack 2021 course 
Python :: python os is directory 
Python :: numpy series reset index 
Python :: python beep 
Python :: kivy date widget 
Python :: pandas replace empty strings with NaN 
Python :: serializers.py include all fields 
Python :: procfile heroku django 
Python :: get hwid python 
Python :: print 1 thing repeatedly in 1 line python 
Python :: python env variable 
Python :: python custom array sort 
Python :: python generate list alphabet 
Python :: django clear db 
Python :: send email hotmail using python 
Python :: delete a record by id in flask sqlalchemy 
Python :: Select rows from a DataFrame based on column values? 
Python :: python localhost 
Python :: python inheritance remove an attribute 
Python :: py exe tkinter 
Python :: datetime to int python 
Python :: random element python 
Python :: Removing all non-numeric characters from string in Python 
Python :: django form datepicker 
ADD CONTENT
Topic
Content
Source link
Name
2+6 =