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
Which two tasks are associated with router hardening? (choose two.)?
nexus9112 [7]

Disabling unused ports and interfaces.

Securing administrative access.

Router hardening means that the router is secured against attacks as best as possible. Router hardening is one among the three areas of router security that must be maintained to secure an edge router at the network perimeter. Basically, router hardening secures from tough-to-crack passwords, to the shutting down of unnecessary interfaces, ports, and services. Look for any unused router interfaces and disable them by issuing the shutdown command. Disabling unused services typically include BOOTP, CDP, FTP, TFTP, PAD, and a few others. You can also disable administrative and management protocols currently not being  like HTTP or HTTPS, DNS, and SNMP.

8 0
3 years ago
How many electrons are there in an atom of carbon? A. Four B. Eight C. Six D. One
DochEvi [55]
It's has six electrons because of it's atomic number
5 0
4 years ago
Read 2 more answers
entry that has the address of 192.168.101.0 and the wildcard mask of 0.0.0.255. What is the range of IPv4 addresses that will be
svp [43]

Answer:

192.168.101.0 through 192.168.101.255 is the correct answer.

Explanation:

The following answer is correct because the address of the ACL entry is 192.168.101.0 and 0.0.0.255 is the wildcard mask then, the range of the IPv4 addresses is 192.168.101.0 through 192.168.101.255 that affected by the ACL.

ACL is referred as the access control list that acts as the firewall which secures the VPC network of the user.

6 0
3 years ago
What was your first experience with listening to kpop?
Verizon [17]

Answer:

My first experience with kpop was when I was six I just danced to it lol I forgot the name of the song but it was funny watching the video of me.

Explanation:

8 0
3 years ago
Read 2 more answers
Write a program that accepts inputs, outputs them and exits correctly when - 1<br> is pressed
dolphi86 [110]

Answer:

Explanation:

The following program is written in Python. It simply creates an endless loop that continously asks the user for an input. If the input is not -1 then it outputs the same input, otherwise it exists the program correctly. A test output can be seen in the attached image below.

while True:

   answer = input("Enter a value: ")  

   if answer != "-1":

       print(answer)

   else:

       break

7 0
3 years ago
Other questions:
  • What is TCP/IP's Transport layer's primary duty?
    8·1 answer
  • One of the difficult decisions a systems analyst has to make when it comes to software is whether to recommend making, buying, o
    13·1 answer
  • What command can be used to export an nps backup file named npsconfig.xml that can be used to restore nps configuration on anoth
    12·1 answer
  • First identify the formula to compute the sales in units at various levels of operating income using the contribution margin app
    12·1 answer
  • Use the drop-down menus to complete each sentence about the layers of the atmosphere.
    14·2 answers
  • What 2 important components are found on a motherboard? (2 points each)
    13·1 answer
  • Knowing and understanding the targeted audience is a main compnent to creating a website
    15·1 answer
  • 25 Points Asap <br> Write a Java program named Light.java that displays a light bulb shown below:
    14·1 answer
  • What are computer specification​
    12·2 answers
  • Task queues, which allow for asynchronous performance, are an important part of modern processing architectures. Information abo
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!