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
Get step-by-step solutions from verified subject matter experts
