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
Why is manual coding the best way to learn HTML?
Stels [109]

Answer:

It helps to put the code in to your working memory and you will have a greater ability to problem solve.

Explanation:

If your just a beginner, then writing the code out your self will help you learn what each line means. Also, you will see the effects that each line has. Of course, this is really dependent on how much code you've written before and how much code your dealing with.

5 0
3 years ago
After you have created at least four slides, a scroll bar containing scroll arrows and scroll boxes will appear on the right edg
neonofarm [45]

Answer:

I THINK THE ANSWER IS ''TRUE''

Explanation:

6 0
3 years ago
clinical outcomes and survival differences between primary, secondary and concomitants carcinoma in situ of urinary bladder trea
8_murik_8 [283]

The summary of the research - clinical outcomes and survival differences between primary, secondary and concomitants carcinoma in situ of urinary bladder treated with BCG Immunotherapy is given below.

<h3>What is the summary of the above research?</h3>

Urinary bladder carcinoma in situ (CIS) is a flat, high-grade, and aggressive form of urothelial cancer with a high likelihood of development to muscle-invasive illness and metastatic dissemination.

The study's goal was to compare the clinical histories and survival rates of primary, secondary, and concurrent CIS of the bladder.

Learn more about Immunotherapy at brainly.com/question/14493516

#SPJ1

6 0
1 year ago
Read 2 more answers
Help me guys pleassssssssse​
Readme [11.4K]

Answer:

is there a word bank??

Explanation:

8 0
3 years ago
What is application launchers functions​
andrey2020 [161]
An app launcher replaces the stock user interface for organizing the home screen and app icons predominantly in the Android world; however, they are also available for jailbroken iPhones (see iPhone jailbreaking and Cydia). See Launchpad.
5 0
3 years ago
Other questions:
  • Write a program that requires the user to enter two floating-point numbers (num1 and num2) from the keyboard. Multiply them and
    6·1 answer
  • Bitnet, one of the predecessors of the internet was launched in 1981. what does bitnet stand for?
    12·1 answer
  • If you do not want to keep a change made by the autocorrect feature, you can click the ____ button on the auto correction option
    12·1 answer
  • What was the first video game ever invented
    11·2 answers
  • Which is not a factor that leads to technological advancement?
    8·1 answer
  • What is a project?
    5·2 answers
  • What PowerShell command can be used to clean up old update files on a WSUS server, including unused update files, old revisions,
    10·1 answer
  • Which are examples of types of audio media that can support a presentation? Check all that apply.
    14·2 answers
  • Your secondary servers have not been able to contact your primary server to synchronize information. How long will the secondary
    12·1 answer
  • First time using this site so be mindful if I make any mistakes
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!