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
Step-by-step 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.