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

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 10:00
Jackson is teaching the decimal number system. he wants his students to know how to expand numbers by powers of 10. which is the correct order in which digits are assigned values in the decimal number system?
Answers: 1
question
Computers and Technology, 22.06.2019 11:50
You have written, as part of a school assignment, a research paper on the solar system. you want to share this paper on your school website. on which type of server will you upload it?
Answers: 1
question
Computers and Technology, 23.06.2019 23:40
4. what is the reason for including the following code snippet in the header file animal.h? #ifndef animal_h #define animal_h class animal { public: animal(); animal(double new_area_hunt); void birth(); void hunt(double new_area_hunt); void death(); double get_area_hunt() const; private: double area_hunt; }; #endif
Answers: 3
question
Computers and Technology, 23.06.2019 23:40
Which of the following calculates the total from the adjacent cell through the first nonnumeric cell by default, using the sum function in its formula? -average -autosum -counta -max
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
question
Mathematics, 02.02.2022 04:20
question
Mathematics, 02.02.2022 04:20
question
History, 02.02.2022 04:40
Questions on the website: 13722363