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
Match each label to the correct location on the image match the process to its characteristics
Lera25 [3.4K]

Answer:

The 2 on the right belong in the drawing section. The left 2 being on the sketch section

Explanation:

A technical drawing is all about precision and using a computer to refine sketches.

4 0
3 years ago
The condition, ____, entered in the criteria row of a long text field in a query window would retrieve all records where the lon
skad [1K]
A query criterion<span> is an expression that Access compares to query field values to determine whether to include the record that contains each value</span><span>
The condition, *education, entered in the criteria row of a long text field in a query window would retrieve all records where the long text field had any mention of education.</span>
6 0
3 years ago
Write the definition of a function named timeOnHighway that receives three parameters, all of type double: mileEndingPoint , mil
dybincka [34]

Answer:double timeOnHighway (double mileEndingPoint, double mileStartingPoint = 0.0, double speed = 55.0)

return (mileEndingPoint - mileStartingPoint) / speed

Explanation:

6 0
4 years ago
Three positive impacts of computer technology in our society.​
Contact [7]

Explanation:

1. it has resulted into the manufacturing of vehicles , trains etc

2. 9through computer technology satellites have been invented to boost education through the use of Internet

3. it has improved agriculture by manufacturing machinery such as tractors, ploughs etc

7 0
3 years ago
Read 2 more answers
PlayStation or Xbox HELP i need to know
Ipatiy [6.2K]
Xboxxxxxxxxx!! inhujhvhvhvhvhvh
3 0
3 years ago
Other questions:
  • A ________ -tier design includes a middle layer between the client and server that processes the client requests and translates
    11·1 answer
  • "This command will give you a listing of your basic IP information for the computer you are using"
    6·1 answer
  • A toolkit is:
    15·1 answer
  • which one of these steps describe saving a newly created file. click on the save icon. minimize the file. name the file. select
    12·2 answers
  • What role does the agenda play in a webinar??
    14·1 answer
  • Tricia needs to tell her browser how to display a web page. What will she need to use? Compiler
    8·1 answer
  • The use of electronic media, information, and communication technologies to deliver instruction where students are not required
    8·1 answer
  • The first thing you should select if you're using an Address Block or Greeting Line is
    11·1 answer
  • Which format has the largest file size?
    10·1 answer
  • Who made the game Monopoly???
    10·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!