Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

how to add a number to each element in an array python with loop

from numpy import *
arr = array([15,2,55,4,5])
for i in range(5):
    res = arr[i]+5
    print(res,end=' ')
 
PREVIOUS NEXT
Tagged: #add #number #element #array #python #loop
ADD COMMENT
Topic
Name
3+2 =