Question: Please use Python only to solve it. Thanks. Using a default value that is complex: Watch out! relocate_evens: The first argument, data, contains integers. We

Please use Python only to solve it. Thanks.

Please use Python only to solve it. Thanks. Using a default value

Using a default value that is complex: Watch out! relocate_evens: The first argument, data, contains integers. We will be removing any evens we find in data, and appending them to the second argument, new_home. A reference to the list which received any evens must be returned. When no second argument is given, a list of all the relocated evens should be created and returned. 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 o Go ahead and use methods like .insert(), .pop), .append () o Examples >>> xs = [1,2,3,4,5] >>relocate_evens (xs) [2,4] >>>XS >>> vals = [6,7,8,9,10] >sanctuary [2,4] >>relocate_evens (vals, sanctuary) [2,4,6,8,10] > sanctuary [2,4,6, 8,10] >>vals [7,9] # same as what relocate evens returned # all evens have been relocated out of here

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!