Question: Write a function called remove_evens(). Given an object, remove_evens() removes any properties whose values are even numbers. Do this in place and return the original

Write a function called remove_evens().

Given an object, remove_evens() removes any properties whose values are even numbers.

Do this in place and return the original object, do not construct a cloned object that omits the properties.

Example:

inp = {'a': 2, 'b': 3, 'c': 4, 'd':'Texas'}

output = remove_evens(inp)

print(output) # --> {'b': 3, 'd':'Texas'}

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!