What would be the output of the following code? If there is…
What would be the output of the following code? If there is an error, write “ERROR” def transform_list(nums, depth): if depth == 0: return nums else: new_nums = [nums[i] * (i + 1) for i in range(len(nums))] return transform_list(new_nums, depth – 1)result = transform_list([2, 3, 1], 2)print(sum(result))
Read Details