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)

print(products)

OUTPUT
[4, 10, 18]
See also  Python code snippet - How clear everything on canvas in tkinter?

Leave a Reply

Your email address will not be published. Required fields are marked *

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