Question: Codio Challenge Question (Python) We are passing in 3 inputs. a list of numbers a multiplier value, M a value, N You should multiply every
Codio Challenge Question (Python)
We are passing in 3 inputs.
a list of numbers
a multiplier value, M
a value, N
You should multiply every Nth element (do not multiply the 0th element) by M. So, if N is 3, you start with the 3rd element, which is index 2.
If there are less than N elements then you should output the unchanged input list.
-----------------------------------------------------------
Expected Output Program Output
Program Failed for Input: 1,2,3,4,5,6 5 3
Expected Output: [1, 2, 15, 4, 5, 30]
-----------------------------------------------------------
Given Code:
# Get our input from the command line import sys M= int(sys.argv[2]) N= int(sys.argv[3])
# convert strings to integers numbers= sys.argv[1].split(',') for i in range(0, len(numbers)): numbers[i]= int(numbers[i])
# Your code goes here
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
