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 territory did the Japanese Empire have in the 1600s?
Find the equation of a line parallel to −x+5y=1 that contains the point (−1,2)
What is the relationship between sin(90°) and sin(−90°)
Which lines from "The Love Song of J. Alfred Prufrock" provide an example of stream of consciousness?
What is the standard deviation of the data set given below? 4, 7, 8, 9, 12 O A. -2.5 O B. 18.5 O c. 6.8 O D. 76.8 E. 2.5 O F. 8.5
Pericles was a leader and lawmaker in ancient Athens. While Athens was fighting the Peloponnesian War, he gave a famous speech called the Funeral Oration. In hi
Find (f•g)(x) for the given functions: f(x) = 5/x and g(x) = 3 + x/5.
By law, all tax laws must originate with the
What is a what if analysis in Excel example?
What is the best way to show a complex data chart in word?