Answers for "python array add to every element"

1

how to add a number to every element in a list python

new_list = [x+1 for x in my_list]
Posted by: Guest on March-12-2021
0

add 1 to all elements in array python

import numpy
a = [1, 1, 1 ,1, 1]
ar = numpy.array(a)
print ar + 2
Posted by: Guest on October-02-2021

Code answers related to "python array add to every element"

Code answers related to "TypeScript"

Browse Popular Code Answers by Language