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
Studentka2010 [4]
3 years ago
10

The function below takes one parameter: a list of numbers (num_list). Complete the function to return a new list containing only

the negative numbers from the original list. For this question, you'll first want to create an empty list. Then, you'll want to visit every element of the original list checking to see if it is negative. For the negative elements, you'll append them to your new list. Finally, return the new list.
Computers and Technology
1 answer:
agasfer [191]3 years ago
6 0

Answer:

Following are the program in the Python Programming language.

#define function

def negative_num(num_list):

 #set list type variable

 nlist=[]

 #set the for loop

 for n in num_list:

   #check negative numbers

   if(n<0):

     #add the value of n in list

     nlist.append(n)

 #return list

 return nlist

#set new list type variable that store list

newl=[-5,8,-6,3,-4,9,-7]

#print and call the function

print(negative_num(newl))

<u>Output</u>:

[-5, -6, -4, -7]

Explanation:

Here, we define the function "negative_num" and pass an argument "num_list" in its parameter and inside the function.

  • Set new list data type variable "nlist".
  • Set the for loop which iterate as the list.
  • Set the if conditional statement to check the value of the list is less than 0 then, add that negative values in the variable "nlist".
  • Then, return the new list.

Finally, we set a variable "newl" which store the list of negative and positive numbers then, we print and call the function.

You might be interested in
Excel templates makes creating a professional looking spreadsheet easier by including all of the following EXCEPT_____ in the te
Anika [276]

Answer:

Excel templates makes creating a professional looking spreadsheet easier by including all of the following except Data  in the template.

Explanation:

Templates are created to define the basic structure of any document which is repeated and the user need not do those designs from the scratch.

Normally a template will contain pre-defined formula, formatting. But it will not contain data because, the purpose of template is that the structure will be same but the value may differ and the template should react according to the data.

So any template will contain design except data. We can use existing template / default template or even create a new one.

4 0
3 years ago
Choose the answer.
expeople1 [14]

There are no options can u give options.

4 0
3 years ago
Graphic design has as its goal the communication of some __________ message to a group of people.
Aleks [24]
Graphic design has as its goal the communication of some specific message to a group of people.

Specific is your answer.
3 0
3 years ago
The theory of continental drift is supported by all of the following EXCEPT
Stels [109]
Climate seems like the correct answer
8 0
3 years ago
Who is a software developer
VARVARA [1.3K]

Software developers are the creative minds behind computer programs. Some develop the applications that allow people to do specific tasks on a computer or another device. Others develop the underlying systems that run the devices or that control networks.

5 0
3 years ago
Read 2 more answers
Other questions:
  • What types of storage can be used to access your data on another computer?
    7·1 answer
  • Which symbol is used to separate a worksheet name from a cell reference?
    10·1 answer
  • How do I download the Microsoft word on my Hp probook
    8·2 answers
  • A program written in a(n) procedural language consists of sequences of statements that manipulate data items. __________________
    9·1 answer
  • Write a loop that inputs words until the user enters STOP. After each input, the program should number each entry and print in t
    12·1 answer
  • I make a budget of my 1st Gamer PC its good?
    9·1 answer
  • Most wires are covered in rubber to insulate them and keep people safe from electricity and heat true of false
    11·1 answer
  • 9. What command do you enter in the Explorer search box to access the Remote Admin share on the computer named Fin?
    7·1 answer
  • What is contained in the Open Files section of Shared Folders? ​
    13·1 answer
  • In this lab, you complete a prewritten Python program for a carpenter who creates personalized house signs. The program is suppo
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!