subject

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.
this is what i have and it doesn't work!
# 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
# i hate that i am not getting this better!
count = -1
while (count < len(numbers)):
numbers[count] = numbers[count]*m
count = count + n;
print (numbers)

ansver
Answers: 2

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 15:30, coollid876
To increase sales, robert sends out a newsletter to his customers each month, letting them know about new products and ways in which to use them. in order to protect his customers' privacy, he uses this field when addressing his e-mail. attach bcc forward to
Answers: 2
image
Computers and Technology, 23.06.2019 16:30, azainababbas
20 points archie wants to use a reflector as he photographs a newlywed couple. what would he consider in his choice? a. shadow and sunny b. homemade and professional c. lamps and boards d. incident and reflected e. neutral density and enhancement
Answers: 3
image
Computers and Technology, 23.06.2019 22:50, christingle2004
What is an rss reader used for? for creating a user account on a social new site
Answers: 2
image
Computers and Technology, 23.06.2019 23:30, cam961
What are "open-loop" and "closed-loop" systems
Answers: 1
You know the right answer?
We are passing in 3 inputs.
a list of numbers
a multiplier value, m
a value, n

Questions in other subjects: