Question: in python 3 imports/ loops are not allowed! please do it recursively 4. recursive onlyEvenDigits (L) (10 pts] Without using iteration and without using strings,
in python 3 imports/ loops are not allowed! please do it recursively
4. recursive onlyEvenDigits (L) (10 pts] Without using iteration and without using strings, write the recursive function onlyEvenDigits(L), that takes a list L of non-negative integers (you may assume that), and returns a new list of the same numbers only without their odd digits (if that leaves no digits, then replace the number with 0). So: onlyEvenDigits([43, 23265, 17, 58344]) returns [4, 226, 9, 844). Also the function returns the empty list if the original list is empty. Remember to not use strings. You may not use loops/iteration in this problem. Hint: We wrote a recursive helper function onlyEvens(n) that takes an integer n and returns the same integer but with all the odd digits removed. So onlyEvens(1234) returns 24
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
