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
Do most good businesses have to deal with conflict
NeX [460]

Answer: Yes.

Explanation: Most good businesses have to deal with conflict, whether it be law suits, unhappy customers, even occasional bad reviews could be considered conflict. although better businesses usually have less conflict than bad businesses

6 0
3 years ago
What is meant by Angular 4?
Blizzard [7]
Hehebebehehehdhdhyuwiiwwiuhwbbwb is bfbbend
6 0
3 years ago
Read 2 more answers
A signal has a spectrum from 0 to 145 Hz, as shown below. It is sampled at a rate of 295 Hz. Find the region of the baseband spe
kirza4 [7]

Answer:  None; all will be recoverable

Explanation:

If a signal (band-limited) is sampled at regular intervals, it could be recoverable or not, based on the number of samples taken.

Let's assume that we want to take samples of a simple sinusoid; If we take more than two samples during a signal cycle, the original waveform will be able to be reconstructed, just passing the sampled waveform through a low-pass filter.

In the more general case in which the signal occupies a frequency spectrum, if the sample frequency is greater than the double of the highest frequency in the spectrum, the signal can be retrieved completely, according to the  Nyquist Theorem.

In this case , as the highest frequency is 145 Hz, it would be enough  to take samples at a rate greater than 290 Hz; As the sample rate is 295 Hz, all the signal can be recovered, at least, using an ideal "brickwall" low-pass filter.

7 0
3 years ago
Read 2 more answers
WNOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOW
beks73 [17]

Answer:

yes.

Explanation:

7 0
3 years ago
Human services organizations seek to make changes and help people in need to improve their .
bixtya [17]

Answer:

quality of life

Explanation:

7 0
3 years ago
Other questions:
  • What is it called when someone attempts to befriend you online for the purpose of stealing confidential or sensitive information
    10·1 answer
  • If images around the edges of a monitor do not look right, the computer might have a(n) access problem. hardware problem. Intern
    13·2 answers
  • If, instead, charge 3 is located to the left of charge 1 at a point (on the x axis) that satisfies the conditions given in the p
    7·1 answer
  • ​______________________ is a general security term that includes computer​ viruses, worms, and trojan horses.
    13·1 answer
  • M f2.app.edmentum.com
    5·1 answer
  • What is the main advantage of using DHCP? A. Allows you to manually set IP addresses B. Allows usage of static IP addresses C. L
    8·1 answer
  • Tips for Interactions with Personalized LinkedIn Outreach?
    5·1 answer
  • Write a complete method from the client perspective that duplicates each element in place in a ListInterface object. For example
    8·1 answer
  • Please help with question
    14·1 answer
  • What is one way object-oriented programming differs from procedural programming?
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!