How to multiply two lists using numpy array in Python

1 Answer

0 votes
import numpy as np
 
list1 = [1, 2, 3, 4]
list2 = [5, 6, 7, 8]
 
arr1 = np.array(list1)
arr2 = np.array(list2)
 
print(arr1 * arr2)


'''
run:

[ 5 12 21 32]

'''

 



answered Jan 24, 2019 by avibootz

Related questions

...