Question: Q5) Define a function indexed_math that takes in two lists of integers as input and outputs a new list of integers. Iterate through the length
Q5) Define a function indexed_math that takes in two lists of integers as input and outputs a new list of integers. Iterate through the length of the shortest input list and do the following: - For every even index, the output list should contain the item in list 1 at that index multiplied by the item in list 2 at that index. - For every odd index, the output list should contain the item in list 1 at that index subtracted from the item in list 2 at that index. - Note: The length of the input strings may differ. In such a case, the output list should be the length of the shortest input list
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
