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

what is the value of 3 in 43,158 and 71,435
What is x? 3x - 4 + 1 = - 2x - 5 + 5x
A corporation needs an operating system that allows the various teams in its office to network and collaborate on projects. Which operating system should the co
Where did portugal and spain claim land in the western hemisphere
Marylou buys a package of 500 jewels to decorate 4 different pairs of jeans. She uses the same number of jewels on each pair of jeans how many jewels will she u
There are 10 vehicles in a parking lot: 3 SUVs and 7 trucks. What is the probability that any 7 randomly chosen parking spots have 2 SUVs and 5 trucks OR 3 SUVs
All agricultural and herding societies eventually become civilizations. a. True b. False
how can i solve this 4(3x-1)=3+8x-11
The narrator of "Uncle John's Farm" is _____.
What is considered the highest law of our land