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
Whether you work in m-commerce, e-commerce, or brick-and-mortar commerce, to be successful you will need to be able to think cri
svlad2 [7]

Answer:

The answer is "Option c"

Explanation:

Decisions made in secret have always been critical. Hence the want to express it before your choice is made. It is all about how you express choice. In general, they need your presentation to explain the choice that you decided, how they created it, and how it implies for just the group, that you are approaching, and wrong choices can be described as follows:

  • In option a, It is used in the industry to interest.
  • In option b, It is use in communication mechanism.
  • In option d, It enables people to handle our activities or carry them out.
3 0
3 years ago
Is a defense of a political position an argument
shutvik [7]

Answer:

yes

Explanation:

yyyyyyyyyyeeeeeeeeesssssss

8 0
3 years ago
what is microprocessor ? Why does a computer need microprocessor? Why does a computer need microprocessor ?​
vesna_86 [32]

Answer:

A microprocessor is a computer processor where the data processing logic and control is included on a single integrated circuit. A computer need microprocessors to perform the functions of a computer's central processing unit.

6 0
1 year ago
You are having a problem with your Windows computer that is isolated to a single graphics editing program that you use every day
Murljashka [212]

Answer:

I'm not a big tech head but I know that creating a restore point is highly recommended for changing anything that you aren't 100% sure about to your computer.

8 0
2 years ago
Complete the following sentences by choosing the best answer from the drop-down menus.
aleksandrvk [35]

Answer:

b. Application software

Explanation:

Applications are type of software that are installed in a specific operating system of a computer that deviates from those system software installed together with the system itself. These third-party applications are necessary for other functions such as entertainment, business, leisure and other needs addressing of which the system software can't provide.

Examples:

Microsoft Office Word, Excel, Powerpoint

i think i did that right:)

7 0
3 years ago
Other questions:
  • Problems with using a single Local Area Network (LAN) to interconnect devices on a premise include ______.
    12·1 answer
  • How can I sent a message?
    13·1 answer
  • Which of the following are types of home internet service? Check all that apply
    7·1 answer
  • Which of the following is not given to a client computer when it is first installed on a TCP/IP network so that it has the appro
    9·1 answer
  • Carbon copy others who are..
    14·2 answers
  • Forms often allow a user to enter an integer. Write a program that takes in a string representing an integer as input, and outpu
    11·2 answers
  • What are the names of the four major varnas in the caste system?​
    9·2 answers
  • What is the first step that you have to perform before you can add a windows package to a wim file?
    9·1 answer
  • Why is it better for a CPU to have more than one cache?
    6·2 answers
  • Class ____________ allow you to create one version of a class, without having to replicate code to handle multiple data types.
    7·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!