Question: Help with this Python 3 function: I can't seem to get this function to work properly and I can't find any solutions as to how

Help with this Python 3 function:

I can't seem to get this function to work properly and I can't find any solutions as to how to figure it out. Any help is appreciated!

Help with this Python 3 function: I can't seem to get this

extract negatives: The first argument, xs, contains integers. We will be removing any negative integers we find in xs, and appending them to the second argument, new home. A reference to the list that received negatives must be returned. When no second argument is given, a list of all the extracted negatives should be created and returned. o Figuring out the signature of this function is part of the task. Careful: What default value do you want to use for new home? What happens when we call the function multiple times in the same coding session? (try it out) o Go ahead and use methods like .insert .pop .append() o You might need to iterate and update the list at the same time. Hint: if you need to traverse a list from front to back, but you don't always want to go to the next index location, while loops can be very useful we get to control when (which iteration) to step forward. Examples: o XS [1 22,3, -44, -5, 6,7] extract negatives (xs) [-22, 44 -51 #return a list of negatives XS [1, 3, 6, 7] fremove negatives from xs o xs [1 22,3, -44, -5,6,71 negatives [-3, -11 extract negatives (xs, negatives) -3, -1, 22, -44, -51 negatives [-3, -1, 22, -44, -51 #new negatives appended to the list XS [1, 3, 6, 7]

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!