Intro to Python-Homework 3-INT-2240
Intro to Python-Homework 3-
- Training Heart Rate The American College of Sports Medicine recommends that you maintain your training heart rate during an aerobic workout. Your training heart
rate is computed as
.7 * (220 – a) + .3 * r,
where “a” is your age and “r” is your resting
heart rate (your pulse when you first awaken). Write a program to request a person’s
age and resting heart rate and display their training heart rate.
Example
Enter your age: 20
Enter your resting heart rate: 70
Training heart rate: 161 beats/min. - Price of Ketchup The following steps compute the price of ketchup.
This should be done inside a function
(a) Create the variable “item” and assign it the value “ketchup”.
(b) Create the variable “regularPrice” and assign it the value 1.80.
(c) Create the variable “discount” and assign it the value .27.
(d) Display the phrase “1.53 is the sale price of ketchup.” using the print() function. - What is the output of the program:
def main():
massKg = 50
# since one stone is equal to 14 pounds
massStone(massKg * 2.2 / 14 )
def massStone(num):
print(“You weigh”, num, “stone.”)
main()
Answer Preview-Intro to Python-Homework 3-INT-2240
$3.00