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
Margaret [11]
4 years ago
9

The function below takes a single parameter number_list which is a list that can contain integers and floats. Complete the funct

ion to return the integer from the provided list that is the largest. There are two recommended approaches for this function. You could either filter out just the integers and use Python's built-in max function, or you could use the find best pattern and only consider list elements that are integers as potentially being the best.
Computers and Technology
1 answer:
Andreas93 [3]4 years ago
6 0

Answer:

  1. def getLargest(number_list):
  2.    new_list = []
  3.    for x in number_list:
  4.        if(isinstance(x, int)):
  5.            new_list.append(x)
  6.    largest = max(new_list)
  7.    return largest  

Explanation:

Firstly, create a function <em>getLargest()</em> that take one input parameter, <em>number_list</em>.

The function will filter out the float type number from the list by using <em>isinstance() </em>method (Line 5). This method will check if a current x value is an integer. If so, the x value will be added to <em>new_list</em>.

Next, use Python built-in <em>max</em> function to get the largest integer from the <em>new_list </em>and return it as output.

You might be interested in
The _______ provides access to the internet; may also be internal?
VikaD [51]
World Wide Web (WWW)? I honestly don't know.
8 0
3 years ago
Many web browsers include _____ tools to make it easier for designers to locate the source of a style that has been applied to a
larisa86 [58]

Answer:

Developer tools.

Explanation:

The main aim of developer tools to loading the HTML(hypertext markup language), CSS and JavaScript it describes how much time takes the page to load in the web browser.

The developer tools make the task easier for the designer to locate the source code which is applied to a specific page element.​We can easily see the source code of the particular website by using the Developer tools. So it makes the task easier for programmers and developers.

4 0
3 years ago
Which search strategy is most similar to greedy search?
lesya692 [45]

Answer:

I think the answer would be A.

Explanation:

If I'm wrong plz let me know (I think I may be wrong)

8 0
3 years ago
A furniture manufacturer wants to find a more environmentally friendly way to make its products. A data analyst helps solve this
Alecsey [184]
The answer has to be true because everything makes sense
4 0
2 years ago
If you created a variable called name, what data type would that value be?
garik1379 [7]

Answer:

a string

Explanation:

bcz that's the only answer

3 0
3 years ago
Read 2 more answers
Other questions:
  • The point at coordinates (2, -18) is in what direction from the origin?
    7·1 answer
  • 5. The shell of a document that may be used over and over in desktop publishing is called a
    14·2 answers
  • List 5 different programming languages calls to print
    8·2 answers
  • What is the single most important component of a computer? Central Processing Unit DIP Motherboard Chipset
    8·1 answer
  • Which PowerPoint options can users customize?
    9·1 answer
  • Assign a variable solveEquation with a function expression that has three parameters (x, y, and z) and returns the result of eva
    6·1 answer
  • Give state diagrams of DFAs that recognize the following languages.
    6·1 answer
  • Which MUD configuration is the most difficult to maintain
    6·2 answers
  • Edhesive 2.3 code practice question 1​
    11·1 answer
  • Identify the names of the following:<br><br>Please help me.​
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!