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
Which of the following tasks requires you to use the Tabs option?
Monica [59]
Indenting a paragraph :)
7 0
3 years ago
The primary function of a __________ is to translate the URL or web address a user enters in a web browser, into the correct cor
Mnenie [13.5K]
The primary function of a " Domain name server (DNS" is to translate the URL or web address a user enters in a web browser, into the correct corresponding IP address.
8 0
3 years ago
_____ is a protocol used by e-mail clients to download e-mails to your computer.
navik [9.2K]
Smtp : Simple Mail Transfer Protocol
3 0
3 years ago
Koi friend online hai kya​
Arlecino [84]

Answer:

yes

good afternoon friend

8 0
2 years ago
An enterprise DBMS is automatically capable of serving as a mobile DBMS. There are no special issues raised by mobility. True Fa
pishuonlain [190]

Answer:

The answer is True.

Explanation:

The enterprise DBMS can also be used with mobile DBMS.

Enterprise DMBS is the latest version of DBMS which is used in organizations and enterprises to handle a huge amount of Data.

Enterprise Database Management System is mainly designed to do large work simultaneously. It can handle multiple queries simultaneously.  

Multiple users (about 100-10,000 users) can access data at the same time and even they can manipulate simultaneously.

The features of Enterprise DBMS is to work efficiently, multi processing, fast, accurately, and handling huge burden of data.

4 0
3 years ago
Other questions:
  • Airbags only absorb the _____ impact in a crash. initial final mid-stage smallest
    13·1 answer
  • The Internet and World Wide Web allow almost any business to be global. What are two important results of this process?
    8·1 answer
  • This is not an appropriate business use for a wiki. editing corporate documents getting customer feedback project management pub
    11·1 answer
  • When you first open a word processor, you’ll find a ? document. A. filled B. blank C. edited
    9·2 answers
  • Complete the sentence.<br> A ___ number is composed of only zeros and ones.
    8·1 answer
  • What are the benefits of writing functions that use parameters and return? Try to list at least two.
    12·1 answer
  • Write a program that administers and grades quizzes. A quiz consists of questions. There are four types of questions: text quest
    13·1 answer
  • Which of the following aspects of a computer is responsible for making sense of input? processing output memory storage
    14·2 answers
  • Consider the conditions and intentions behind the creation of the internet—that it was initially created as a tool for academics
    12·1 answer
  • Im learning about AI in my class and I'm confused about these two questions
    9·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!