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]
3 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]3 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
Tom teaches in a high school. He wishes to sort a spreadsheet containing students' marks in various subjects by descending order
cricket20 [7]

Answer:

Select the data to sort

Explanation:

4 0
3 years ago
Which technology will a business use to identify unauthorized access to intranet sites or files by its employees?
monitta

Answer:

Computer Forensics

Explanation:

Your Welcome....

8 0
2 years ago
When you create a user with the useradd command, what is the immediate state of it?
kipiarov [429]

When a user is created in Linux using the useradd command, the <em>immediate state</em> of the created account is locked.

  • The useradd command can be invoked in other to create a new user account using the following command

sudo useradd fast_user

<em>#fast_user</em><em> </em><em>is</em><em> </em><em>the</em><em> </em><em>name</em><em> </em><em>of</em><em> </em><em>the</em><em> </em><em>account</em><em> </em><em>created</em><em> </em>

  • At this point, the account has been created but it will be locked until the required login details are set. This can be achieved using the line ;

sudo passwd fast_user

Therefore, an account created using the useradd command is in a locked state.

Learn more :brainly.com/question/12135504?referrer=searchResults

5 0
2 years ago
When entering numbers that start with a zero, apply the _____ number format.
yuradex [85]

Answer:

The Answer is gonna be D. Zero decimal

3 0
2 years ago
A major advantage of a method is that it is easily reusable. What does it mean to reuse a method and what are the advantages of
JulijaS [17]

Answer: To reuse a method means to use a code which has been done or prepared already and just we need to change some of the functionalities.

This helps a great deal of saving time as well as helps in making the code manageable.

Explanation:

This has been practiced since long that methods can be reused. for example we need to build a calculator in c. then we can simply reuse the same method  just we need to change the sign of the operator. So in this process we can speed up our operations and work and also can make the code easy to understand and manage it when we have have to deal with large lines of code.

8 0
3 years ago
Other questions:
  • A peripheral can be used to tell a computer to complete a specific task. True False
    15·1 answer
  • Although highly accurate navigational information from the GPS constellation is exploitable by adversary forces, it is unlikely
    5·1 answer
  • Are one of the greatest features of Photoshop that allow nondestructive editing of images.
    6·1 answer
  • Are storage devices input devices
    8·1 answer
  • ANSWER ASAP!!!!!
    10·2 answers
  • What is cyber ethics​
    10·2 answers
  • Write a function endpoints that takes a list of numbers (eg. [5, 10, 15, 20, 25]) and returns a new list of only the first and l
    15·1 answer
  • Which letter shows the ball when it has the maximum kinetic energy
    15·1 answer
  • If each integer occupies one 64-bit memory cell and is stored using sign/magnitude notation, what are the largest (in terms of a
    12·1 answer
  • A video consists of a sequence of:
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!