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
Dvinal [7]
3 years ago
5

The function below takes a single parameters: a list of numbers called num_list. Return a new list containing just the three lar

gest numbers (in any order). Your function shouldn't modify the original list. You can assume that the list always contains at least 3 numbers. The easiest way to accomplish this is to sort the provided data and then slice, but you'll need to make a copy of the data (so that you don't modify the original list).
print.py 1. hef three_largest numbers(num_list):
Computers and Technology
1 answer:
yarga [219]3 years ago
8 0

Answer:

  1. def three_largest_numbers(num_list):
  2.    sort_list = num_list
  3.    sort_list.sort(reverse=True)
  4.    return sort_list[0:3]
  5.    
  6. print(three_largest_numbers([5, 7, 1, 8, 9, 3, 6]))

Explanation:

Firstly, we declare a function that will take one input list, num_list (Line 1). To avoid modifying the original num_list, we create a copy of num_list and assign it to a new list, sort_list (Line 2) in the function. Next, we use Python list  sort function to sort the list in descending order (Line 3). At last, return the first three elements of the sort_list as output (Line 4).

We test the function using a sample list (Line 6) and we shall get [9, 8, 7] printed in terminal.

You might be interested in
A specific packet journey, from your computer to a remote server, end-to-end across multiple networks, has the following link ba
MrRa [10]

Answer:

0.125 seconds

Explanation:

The formula for the time taken to transfer the file is = file size / bandwidth

Assuming the computer and server could only transfer data at the speed of 1000 Mbps or more, The time of transmission is;

= 125 MB / 1000 Mbps = 0.125 seconds.

3 0
3 years ago
The _______ valve protects the air pump from reverse-exhaust pressure.
alexandr402 [8]
D. The answer for this is the gulp
7 0
3 years ago
THE DOMAIN IN AN EMAIL MESSAGE TELLS YOU THE
german
The domain in an email message tells you the type of service provider.

Hope this helped! :)
3 0
4 years ago
After several configuration changes are made to a router, the copy running-configuration startup-configuration command is issued
adoni [48]

Answer: NVRAM(Non-volatile random-access memory)

Explanation:Non-volatile random-access memory(NVRAM) is the memory that has a non-volatile nature.It is used for retaining of the data even when the system gets switched off .

This memory uses the power source from the CMOS battery for executing the functions. It is designed by using the pin configurations containing 24 pin in DIP(Dual inline package). So the situation mentioned in the question of storing the changes will appear in the NVRAM.

4 0
4 years ago
Jerry suspects that information about his Internet usage was sent to external websites without his knowledge. He is wary about t
balu736 [363]
I would say some kind of anti cookie software. Cookies are what the websites store to track info about you and your preferences. If you blocked their data collectors or turned of cookies for websites, you would likely stop getting ads and newsletters.
3 0
3 years ago
Other questions:
  • Being able to download a chapter of a new book before buying it, or listening to a few seconds of a song before purchasing it ar
    7·1 answer
  • Type the correct answer in the box. Spell all words corre ctly.
    15·2 answers
  • Digital libraries are often available to students and/or employees at colleges, schools, and BLANK institutions.
    15·1 answer
  • __ provides an integrated development environment (IDE) for rapidly developing Java programs. Editing, compiling, building, debu
    15·1 answer
  • Which term is defined as an exploit that takes place before the security community or software developer knows about the vulnera
    12·1 answer
  • Can someone please‼️‼️❗️help me with this?<br> I got an error that I can’t figure out how to fix it.
    6·1 answer
  • (ACCESS 2016)
    7·2 answers
  • Three Cat 5e cables were run from an office area to three computers in a machine shop. Work took place on the weekend when the m
    14·1 answer
  • The Circle and CircleTester have been created, but they have errors. The public and private settings for variables and methods a
    8·1 answer
  • look for ten websites and classify them as static or dynamic what makes each websites static or dynamic?
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!