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
VikaD [51]
3 years ago
14

The benefit from dividing code into methods known as ________ is gained as follows: After you write code to perform a task once,

you can use the code again every time your program needs to perform the same task.
Computers and Technology
1 answer:
Fynjy0 [20]3 years ago
7 0

Answer: B: Divide and Conquer

Explanation:

You might be interested in
Write a function maxTemp which takes a filename as string argument and returns the maximum temperature as float type for the wee
Alenkinab [10]

Answer:

#section 1

def maxTemp(filename):

   import pathlib

   f = pathlib.Path(filename)

   f.exists()

   if f.exists():

       f = open(filename, "r")

#section 2

       next(f)

       res = [int(sub.split(',')[1]) for sub in f]

       maxdata = (res[0])

       for i in range(len(res)-1):

           if maxdata < res[i]:

               maxdata = res[i]

       

       index = res.index(maxdata)

       f.close()

 #section 3  

       li = []  

       a = open(filename, "r")

       for line in a:

           line = line.strip()

           li.append(line)

   

       

       a.close()

       return (li[index+1])

   else:

       return -1

print(maxTemp("new.csv"))

Explanation:

#section 1:

The function maxTemp is defined. We import pathlib in other to check if the file exists, if it does we carry on with opening the file and if it doesn't the program returns -1.

#section 2:

We start splitting the sub-lists from the second line i.e <em>next(f)</em>. For each line we take the second index element and convert it to an integer.

<em>res = [int(sub.split(',')[1]) for sub in f] </em>

The maximum number is gotten by using the if statement to compare all elements in the list.  The index of the maximum item in the list is collected.

the file is then closed.

#section 3  :

The file is re-opened and all the lines are striped and passed into a new list and the index recovered from section 2, is used to get the day with the highest temperature and the line is returned.

8 0
3 years ago
While speech recognition can operate without any confi guration, you can train it to more accurately recognize your voice. true
Natasha_Volkova [10]
True because any one can change or fix their voice just by practicing a voice.
3 0
4 years ago
I dont know how to put the negative sigh on my computer
valina [46]
You put the dash on the right side up top ape
8 0
3 years ago
Read 2 more answers
A leading global vendor of computer software, hardware for computer, mobile and gaming systems, and
V125BC [204]

Answer:

Microsoft

Explanation:

5 0
2 years ago
You cannot advance slides during the slide show by pressing the PAGE DOWN key
noname [10]
<span>You cannot advance slides during the slide show by pressing the PAGE DOWN key.
This is a true statement.
</span>
4 0
3 years ago
Other questions:
  • Due to the internal style sheets of some browsers, your website may look different to someone who is using firefox as opposed to
    11·1 answer
  • The term integration refers to the ability to
    6·1 answer
  • Cual es la herramienta de google que funciona como oficce ?
    11·1 answer
  • Create an application named TurningDemo that creates instances of four classes: Page, Corner, Pancake, and Leaf. Create an inter
    7·1 answer
  • The goal expressed in this definition states that data visualization is about ______ . 1. Interpreting 2. Perceiving 3. Facilita
    6·1 answer
  • According to the government, employees have a right to understand the risks associated with the materials they work with.
    15·1 answer
  • What is a single-user computer?
    8·1 answer
  • Compute their Cartesian product, AxB of two lists. Each list has no more than 10 numbers.
    5·1 answer
  • PLS HURRRYYYYYY!1!1!1!1!1
    5·2 answers
  • Which of the following rules need to be followed when using variables?<br> Choose all that apply.
    9·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!