Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

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)
Comment

PREVIOUS NEXT
Code Example
Python :: You will be passed a file path P and string S on the command line. Output the number of times the string S appears in the file P. 
Python :: pyspark rdd sort by value descending 
Python :: sowpods python 
Python :: Return a new RDD containing only the elements that satisfy a predicate. 
Python :: Find the minimum item in this RDD 
Python :: how to let the user input desmials in python 
Python :: say hello to someone in python 
Python :: python download sklearm model.joblib from google stroage 
Python :: pygame rect follower 
Python :: access data frame element by loc 
Python :: (908) 403-8900 
Python :: how to call the tkinter insert command from another class 
Python :: get the factorial of a number on python 
Python ::  
Python :: how to increment a variable in python] 
Python :: inicair venv python 
Python :: how to use put method in django 
Python :: python list of difference beetwen values in list 
Python :: jupyter lab extensions not working 
Python :: autoscrapper basic code 
Python :: For an HTML output, you don’t need an additional library. It simply goes like this: 
Python :: call a function with prameters inm tkinter buttion 
Python :: python to java converter 
Python :: can we use python functions in node 
Python :: daraframe get top n max value 
Python :: print without parenthesis 
Python :: conversion un type image en array python 
Python :: chrome crushs in selenium 
Python :: training T5 for summarization 
Python :: pe039 
ADD CONTENT
Topic
Content
Source link
Name
2+7 =