ianpaule2727 ianpaule2727
  • 24-11-2020
  • Computers and Technology
contestada

mins_by_phone(phone): calculate and return the number of call minutes associated with the given phone line in this plan based on

Respuesta :

IfeanyiEze8899 IfeanyiEze8899
  • 26-11-2020

Answer:

def mins_by_phone(phone):

   if phone in self.phones:

       min_sum = 0

       for call in calls:

           min_sum += call

           return min_sum

   else:

       return 0

Explanation:

The mins_by_phone function above is the Phone class method. It checks for the presence of the argument value in the self.phones instance variable, which is a list and  sums up and returns the call minutes in the call list.

Answer Link

Otras preguntas

A firm owned by a single person who shares profits and losses with no one else is a __________.
What part of the plant gives sugar
FIND THE DIFFERENCE (5x2 + 2x + 11) - (7 + 4x - 2x2) A. 9 - 2x - 2x2 B. 3x2 - 2x + 4 C. 3x2 + 6x + 4 D.7x2 - 2x + 4
Find the length of side c of a triangle if side a = 15 and side b = 20. A. 25 B. 17.5 C. 20 D. 15
Which idea is central to democracy in the United States?
greg bought 2 boxes of balloons. he used half of them to decorate his yard. He used 40 to decorate his porch. He used the rest inside his house. how many balloo
What is the expression x2-4 for a=b=3x=5 and y=4
Which civilization is credited with recording data with quipu, developing an elaborate road system, and constructing Machu Picchu? (1) Roman (3) Mesopotamian (2
find a number greater than 25 that has more factors than the numbers
A firm owned by a single person who shares profits and losses with no one else is a __________.