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
Type the correct answer in the box. Spell all words correctly.
Vanyuwa [196]

my guess would be HTML.

4 0
3 years ago
What is the target audience for this poster?
bija089 [108]

Answer:

there is no car on a bus a bus is one long vehicle

Explanation:

7 0
3 years ago
Read 2 more answers
What does this say:<br> √ans
dangina [55]

Answer: I do belive is says Vans

Explanation:

5 0
3 years ago
Read 2 more answers
In 1–3 sentences, describe one reason you would import data into a database.
Norma-Jean [14]

Answer and Explanation

A database is an organised collection of a data which is stored and can be easily, managed, updated and can be accessed electronically when required. The reason for importing your data into the data base is because this data is secure from unauthorized people. This is because to access this data you need to login. You can also update it and access it electronically when the need be.

8 0
3 years ago
Read 2 more answers
Im sad cheer me up please
SSSSS [86.1K]

Answer:

Don't worry !! Everything will be fine

Explanation:

5 0
3 years ago
Read 2 more answers
Other questions:
  • Linda has written a program that works well on various operating systems, but she needs to increase the readability of the progr
    14·1 answer
  • Survey Q. Non-scoring: What role is played in the team? (1 correct answer)
    14·1 answer
  • The _____ model of a systems development life cycle provides for progressive development of operational software, with each rele
    8·1 answer
  • What is a row of data in a database called?<br> Field<br> File<br> Record<br> Title
    10·1 answer
  • Once the term of copyright has expired,a work
    15·1 answer
  • Write a perl program that reads from a file containing a list of names and then displays that list to a user. The program should
    11·1 answer
  • You are a network administrator for a company that has two buildings. You are setting up a wireless network so users can maintai
    8·1 answer
  • Several people work with data at Erica’s office. She enters data. One of her coworkers enters new product numbers. Another cowor
    5·1 answer
  • 3. Compilers and Assemblers translate each source file individually to generate object code files. Hence the object files need t
    13·1 answer
  • Suppose that a t-shirt comes in five sizes: S, M, L, XL, XXL. Each size comes in four colors. How many possible t-shirts are the
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!