Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

list help Coding Problem 4.3.6 (External resource) (3.0 points possible) Fitbitpy SubmitRun Grades Reset 1 #Imagine you're writi some code for an exercise tracker Console

image text in transcribedlist help

Coding Problem 4.3.6 (External resource) (3.0 points possible) Fitbitpy SubmitRun Grades Reset 1 #Imagine you're writi some code for an exercise tracker Console output will be displayed here 2 #The tracker, measures heart rate, and should display the 3 #average heart rate from an exercise session 5?However, the tracker doesn't automatically know when the 6 #exercise session began. It assumes the session starts the 7 #first time it sees a heart rate of 100 or more, and ends B #the first time it sees one under 100 16 #Irite a function called average heart rate 11 average-heart-rate should have one parameter, a list of 12 #integers. These integers represent heart rate measurements 13 #taken 30 seconds 14 #the average of all heart rates between the first 18 + 15 theart rate and the last one. Return this as an integer 16 #(use floor division when calculating the aver ge) apart. average heart rate should return 17 # 18 #You nay assume that the list will only cross the lee beats 19 #perninute threshold once: once it goes above 100 and below 20 #again, it will not go back above 21 23 #Add your function here! 24 25 26 27 #Below are sone lines of code that will test your function 28 You can change the value of the variable(s) to test your 29 #function with different inputs. 30 # 31 #If your function works correctly, this will originally 32 #print 114 (because there are 13 measurements from 102 to 3 #101, their sum 15 1484, and 1484 // 13 is 114) 34 beats-[72, 77, 79, 95, 102, 105, 112, 115, 120, 121, 121, 35 36 print(average_heart rate(beats)) 37 25, 125, 123, 119, 115, 10, 191, 96, 92, 90, 85] 39

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Transact SQL Cookbook Help For Database Programmers

Authors: Ales Spetic, Jonathan Gennick

1st Edition

1565927567, 978-1565927568

More Books

Students also viewed these Databases questions