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]
4 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]4 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
____ data refers to signals representing sound, temperature and car speed. These signals
taurus [48]

Answer:

digital

Explanation:

dspDigital signal processing (DSP) is the use of digital processing, such as by computers

8 0
3 years ago
write two paragraphs (at least 5 sentences each) about what President Biden and Vice-President Harris plan to do during the firs
frozen [14]

Answer:

writing one in comments bec i don't have time for both sorry

4 0
3 years ago
What’s the difference between a stream and a tab?
Elza [17]

Answer:

Option (D) is the correct option to the following question.

Explanation:

Because a tab is labeled the stream i.e., dashboard, tab is the former representation of user profile in their social media account and streams displays only the different forms of one user profile. They also are the conversations, timeline, and post of any users' profile.

6 0
4 years ago
⚠️⚠️⚠️⚠️⚠️⚠️Help! What is not an advantage of using virtual machines?
Luda [366]

Answer:

It doesn’t take up any storage space on the physical machine.

Explanation:

The virtual machine does take up some storage space on the physical machine.

5 0
3 years ago
Please tell fast plzzzzzz.​
lana [24]

Answer:

True

Explanation:

4 0
3 years ago
Other questions:
  • Suppose you define a java class as follows: public class test { } in order to compile this program, the source code should be st
    14·1 answer
  • What is Administrator windows 10
    8·1 answer
  • What does psychologist Edward Spector mean when he says “ We have an entire generation of guinea pigs in an experiment”?
    14·1 answer
  • Joining strings together is known as?
    7·1 answer
  • Battery maker Duracell introduced a new product called the Duracell Powermat, which is a wireless charging pad for mobile device
    12·1 answer
  • Late at night, some traffic signals change patterns and become _____.
    9·2 answers
  • Explain the difference between the legal protections a security officer enjoys and the legal protections a police officer receiv
    12·2 answers
  • What is the value of the average variable after the following code is executed? var sum = 0; var prices = [14, 10, 9, 12, 11, 14
    14·1 answer
  • What is the term meaning a Java object that has attributes and methods?
    12·1 answer
  • The price of an item you want to buy is given in dollars and cents. You pay for it in cash by giving the clerk d dollars and c c
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!