Answers for "multiply every nth element"

0

multiply every nth element

# multiply every Nth element
numbers = [1,2,3,4,5,6]
N = 7
M = 2
for i in range(N - 1, len(numbers), (N)):
    (numbers)[i] = (numbers)[i] * (M)
print(numbers)
Posted by: Guest on January-29-2020

Code answers related to "multiply every nth element"

Python Answers by Framework

Browse Popular Code Answers by Language