Skip to content

How to multiply two arrays in Python?

list1 = [1, 2, 3]
list2 = [4, 5, 6]
products = []

for num1, num2 in zip(list1, list2):
	products.append(num1 * num2)


[4, 10, 18]
See also  How to read text file in Java using bufferedreader?

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.