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 :: python divide string in half 
Python :: pandas drop zero values 
Python :: python str replace specifiek index 
Python :: opencv write text 
Python :: how to add list item to text file python 
Python :: replit clear 
Python :: python - remove scientific notation 
Python :: python copy dir 
Python :: how to open file in BeautifulSoup 
Python :: cv2 save video mp4 
Python :: get current time in python with strftime 
Python :: copy text python 
Python :: python requests wait for page to load 
Python :: python server http one line 
Python :: pandas plot xlabel 
Python :: install library from python code 
Python :: how to create migrations in django 
Python :: runserver manage.py 
Python :: how to plot 2 decimal values in axis python 
Python :: django integer field example 
Python :: python get current time without milliseconds 
Python :: how to make a text input box python pygame 
Python :: brownie to wei 
Python :: plt off axis 
Python :: r squared python 
Python :: FutureWarning: The frame.append method is deprecated and will be removed from pandas in a future version. Use pandas.concat instead. 
Python :: how to create a car game using python 
Python :: how to get the angle of mouse from the center 
Python :: how to get all the files in a directory in python 
Python :: check odd numbers numpy 
ADD CONTENT
Topic
Content
Source link
Name
7+5 =