Question: (c) Define get_list_of_powers in HW1.py The function get_list_of_powers takes in a list X and integer k and returns a list L whose elements are themselves


(c) Define get_list_of_powers in HW1.py The function get_list_of_powers takes in a list X and integer k and returns a list L whose elements are themselves lists. The i th element of L contains the powers of x[i] from 0 to k. = For example, running get_list_of_powers with inputs X = [5, 6, 7] and k = 2 will return [[1, 5, 25], [1, 6, 36], [1, 7, 49]] . (d) Define get_list_of_even_powers in HW1.py As in (c), the function get_list_of_even_powers takes in a list X and inter k , and returns a list L whose elements are themselves lists. But now L includes only even powers of elements of X. For example, running get_list_of_even_powers with inputs X = [5, 6, 7] and k 8 should return [[1, 25, 625, 15625, 390625], [1, 36, 1296, 46656, 1679616), [1, 49, 2401, 117649, 5764801]] . =
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
