0
Can we multiply the the whole array elements by single element at a time without using loops???
if a=[1,2,3] and multiplying the whole by 3.. then we should obtain a=[3,6,9]
7 Respuestas
0
it mean???
0
There is one more way around it:
import numpy
a = [1, 2, 3]
b = numpy.array(a)
print(b * 3)
Arrays created using numpy library look just the regular ones, but they have their own class and additional functionality. In this case b is a numpy array and it will behave just like you want it to.
0
should we require any header file for it?? and in which programming language we can get it? @Lana
0
@hamsa
The example code is for Python. As far as I know, you don't need to do anything else, if the numpy library is already installed