How do we calculate the BMI in python?
the formula is kg/m²

Answers

Answer 1

Answer:

height = float(input("Enter your height in m: "))

weight = float(input("Enter your weight in kg: "))

BMI = weight / (height/100)**2

print(f"You BMI is {BMI}")

Explanation:

The python code for calculating BMI is as follows -

height = float(input("Enter your height in m: "))

weight = float(input("Enter your weight in kg: "))

BMI = weight / (height/100)**2

print(f"You BMI is {BMI}")

Some conditions can also be added such as

if BMI <= 15:

   print("You are underweight.")

elif BMI <= 30:

   print("You are healthy.")

elif BMI <= 40:

   print("You are over weight.")


Related Questions

Andy is working on a project to build an accounting software program for his firm. He uses old programming modules that contained code to perform various processes and links them to create a complete system. Which approach does he apply to the program design?
A.
structured programming
B.
non-structured programming
C.
top-down approach
D.
bottom-up approach
E.
modular programming

Answers

Answer:

E.  modular programming

Explanation:

Andy is applying a design known as modular programming. This is basically a design in which the entire project is broken down into various parts known as modules. Each one of these modules performs a very different and unique task. As the modules are created they are linked together like pieces of a puzzle in order to form the entire project. This makes tackling a large project much easier and makes debugging problems much easier as well.

edhesive assignment 2: room area?

Answers

Explanation:

a, b, c, d, e = input("A ="), input("B ="), input('C = '), input("D = "), input('E = ')

print(float(a*b + sqrt(c**2-(a/2)**2) * a/2 * 0.5))

a, b, c, d, e = input("A ="), input("B ="), input('C = '), input("D = "), input('E = ') print(float(a*b + sqrt(c**2-(a/2)**2) * a/2 * 0.5))

What is program?

The program is an illustration of functions. Functions are groups of code segments that are executed when called or evoked

The calendar program

The calendar program in Python, where comments are used to explain each line is as follows:

#This checks for leap year

def leap_year(y):

if y % 4 == 0:

return 1 else return 0

#This returns the number of days in the month

def number_of_days(m,y):

if m == 2:

return 28 + leap_year(y)

elif m == 1 or m == 3 or m == 5 or m == 7 or m == 8 or m ==10 or m == 12:

return 31

elif m == 4 or m == 6 or m == 9 or m == 11:

return 30

#This returns the number of days left in the month

def days(m,d):

dayList = [0,31,59,90,120,151,181,212,243,273,304,334]

return dayList[m-1] + d

#This returns the number of days left in the year

def days_left(d,m,y):

if days(m,d) <= 60:

return 365 - days(m,d) + leap_year(y) else:

return 365 - days(m,d)

#The main begins here

#This next three lines gets input for date

day=int(input("Day: "))

month=int(input("Month: "))

year=int(input("Year: "))

#This gets the choice from the user

menu=int(input("Press 1 to calculate the number of days in the given month.\nPress 2 to calculate the number of days left in the given year.\nChoice: "))

#This prints the number of days in the month

if menu == 1:

print(number_of_days(month, year))

#This prints the number of days left in the year

elif menu == 2:

print(days_left(day,month,year))

Read more about Python functions at:

brainly.com/question/14284563

#SPJ7

The complete part of the question will be:

Assignment 3: Chatbot

What the code for assignment 3: chatbot Edhesive.

You are designing an ecommerce web application that will scale to hundreds of thousands of concurrent users. Which database technology is best suited to hold the session state in this example

Answers

Answer: Amazon DynamoDB

Explanation:

The database technology that is best suited to hold the session state in this example is the Amazon DynamoDB.

Amazon DynamoDB is a document database which helps in delivering high quality and fast cperformance at any scale. It can be used to scale to hundreds of thousands of concurrent users as it's multi-active, and has a durable database that has built-in security.

Other Questions
As Soon As Possible! (please)Each day a supernatural termite can eat 35% more wood grains that it did the day before. If a 20-day old termite has eaten 97,231 grains of wood, how many wood grains (to the nearest grain) will it eat on the 22nd day? A) 84 grains B) 130,745 grains C) 176,589 grains D) 235,768 grains The sum of a triangle's sides is34.5 cm. The shortest side is7.5 cm and the middle-lengthside is 3 cm longer than theshortest side. Find the lengthof the third side and classifythis triangle by the lengths ofits sides. How to write a letter to your headteacher and explain why you have not reported Summary of chapter 1 The Last Lesson Item 5A mold fossil may fill in with sediment.When the sediment hardens, it becomes what type of fossil?trace fossilmold fossilcast fossilpetrified wood Given that P(A and B) = 0.20 and P(A|B) = 0.40, what must the P(B) = ?a. 0.1b. 0.2c. 0.4d. 0.5 Elisa y Romina tienen 5/8 de pizza y decidieron dividrsela en partes iguales. Qu parte de la pizza completa le toc a cada una? 15 POINTS PLSIn art, we use value to show that forms are 2 Dimensional. True or false when the a value is negative in any quadratic what do you know about the graph? Which of the pairs of angles are vertical angles and thus congruent? A and G A and B C and F D and H Burrowing owls sometimes build their nests in holes that were dug by prairie dogs, coyotes, or badgers and have been since abandoned. They sometimes line the nests with cattle or horse dung. Why Which throwing cue includes flicking the wrist?HugExtendThrow/ReleaseFollow Through Express 848.41 m in millimeters What is a cognitive milestone of a baby Forces can stop the movement of an object How did China create an effective government during the postclassical era?A. It let the common people pick their own government leaders.B. It relied mostly on powerful generals to run its government.C. It used civil service exams to select government officials.D. It allowed foreign officials to control most of its government. You are designing an ecommerce web application that will scale to hundreds of thousands of concurrent users. Which database technology is best suited to hold the session state in this example Good morning, can someone help me solve this problem? I already did some of it but I need help, thank you Imagine you the Environment Minister, What all Changes you want to bring for your region to conserve the resources (LIST OUT) (a) 34 is 85% of what number?