Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

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]
Comment

PREVIOUS NEXT
Code Example
Python :: get flask version 
Python :: channel lock command in discord.py 
Python :: remove all integers from list python 
Python :: import django-on-heroku 
Python :: how to input a string in streamlit 
Python :: panda categorical data into numerica 
Python :: python remove first item in tuple 
Python :: django check if queryset is empty 
Python :: force garbage collection in python 
Python :: Python make directories recursively 
Python :: upload py file using flask 
Python :: shutil remove 
Python :: How to convert simple string in to camel case in python 
Python :: pygame music player 
Python :: get first line of file python 
Python :: collections counter 
Python :: Simple way to measure cell execution time in jupyter notebook 
Python :: pandas read csv skip first line 
Python :: sort dict by value 
Python :: python choose sample from list with replacement 
Python :: pandas number of columns 
Python :: sleep in python 3 
Python :: fastest clicker python 
Python :: how to install from url in python 
Python :: group by but keep all columns pandas 
Python :: get one from dataloader 
Python :: add column array python 
Python :: python is float 
Python :: pgcd python 
Python :: python sentence splitter 
ADD CONTENT
Topic
Content
Source link
Name
4+7 =