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.
 Q5) Define a function indexed_math that takes in two lists of

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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!