1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
siniylev [52]
4 years ago
12

#Imagine you're writing some code for an exercise tracker. #The tracker measures heart rate, and should display the #average hea

rt rate from an exercise session. # #However, the tracker doesn't automatically know when the #exercise session began. It assumes the session starts the #first time it sees a heart rate of 100 or more, and ends #the first time it sees one under 100. # #Write a function called average_heart_rate. #average_heart_rate should have one parameter, a list of #integers. These integers represent heart rate measurements #taken 30 seconds apart. average_heart_rate should return #the average of all heart rates between the first 100+ #heart rate and the last one. Return this as an integer #(use floor division when calculating the average). # #You may assume that the list will only cross the 100 beats #per minute threshold once: once it goes above 100 and below #again, it will not go back above.
Computers and Technology
1 answer:
xeze [42]4 years ago
8 0

Answer:

Following are the code to this question:

def average_heart_rate(beats):#defining a method average_heart_rate that accepts list beats  

   total=0 #defining integer variable total,that adds list values  

   count_list=0#defining a count_list integer variable, that counts list numbers  

   for i in beats:#defining for loop to add list values  

       if i>= 100:#defining if block to check value is greater then 100

           total += i#add list values

           count_list += 1# count list number  

   return total//count_list #return average_heart_rate value  

beats=[72,77,79,95,102,105,112,115,120,121,121,125, 125, 123, 119, 115, 105, 101, 96, 92, 90, 85]#defining a list

print("The average heart rate value:",average_heart_rate(beats)) # call the mnethod by passing value

Output:

The average heart rate value: 114

Explanation:

In the given question some data is missing so, program description can be defined as follows:

  • In the given python code, the method "average_heart_rate" defined that accepts list "beats" as the parameter, inside the method two-variable "total and count_list " is defined that holds a value that is 0.
  • In the next line, a for loop is that uses the list and if block is defined that checks list value is greater then 100.
  • Inside the loop, it calculates the addition and its count value and stores its values in total and count_list  variable, and returns its average value.
You might be interested in
Explain the difference between true north and magnetic north.
Furkat [3]
Magnetic north is the north a compass points in the direction of. True north, on the other hand, is north based on the earth's axis.
4 0
3 years ago
The _______ is a small program run by a computer when first powered on. its primary function is to stabilize the machine and dev
tigry1 [53]
Hello <span>TheCelloAlex1645 </span>

Answer: <span>The BIOS is a small program run by a computer when first powered on. its primary function is to stabilize the machine and devices on the motherboard so that the operating system can be loaded and take control of the computer.


Hope this helps
-Chris</span>
3 0
3 years ago
5.2
Ray Of Light [21]

Answer:

In order to reduce the risk of accidents on the roads.

Explanation:

The special equipment is used when  testing eyesight for a driver's license in order to reduce the risk of accidents on the roads. Good eyesight is very important for good and safe driving so to find out the eyesight of the driver, the license officer used special equipment in order to check driver's eyes. If the eyesight is good, the officer provide license to the person otherwise not so that no accidents happen on the road.

8 0
3 years ago
The ram called a volatile device select one:<br><br> a. false<br><br> b. true
Paraphin [41]
B. true

RAM (Random Access Memory) is volatile because if power is lost, so is your memory.
6 0
3 years ago
Determine the Bcd equivalent 1100111110101001
Vilka [71]

Answer:

01010011000101100001

Explanation:

In computing and electronic systems, a binary-coded decimal (BCD) is a digital encoding method for decimal numbers in which each digit is represented by its own binary sequence.

8 0
3 years ago
Other questions:
  • In 1–2 sentences describe how you would insert a row in a spreadsheet.
    6·2 answers
  • How do I take off the header off my second page in google docs ? ( I only need it on page 1)
    8·2 answers
  • Which relationship is possible when two tables share the same primary key? one-to-one one-to-many many-to-one many-to-many
    15·2 answers
  • Write a program that does the following: • Alphabetizes a list of small (non-capital) letters. For consistency, make the string
    14·1 answer
  • The INC and Dec instruction do not effect the__________ flag
    6·1 answer
  • Assign the size of userInput to stringSize. Ex: if userInput is "Hello", output is: Size of userInput: 5
    7·1 answer
  • Which button would you use to insert a downloaded video clip on your computer into a slide?
    15·2 answers
  • During the design phase of the systems development life cycle (SDLC), the _____ design is created for a specific platform, such
    8·1 answer
  • I want to sign up for brainly but it won't let me. It keeps saying "we can complete your registration at this time".
    13·1 answer
  • Which statement about analog and digital images is true?.
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!