Welcome to collectivesolver - Programming & Software Q&A with code examples. A website with trusted programming answers. All programs are tested and work.

Contact: aviboots(AT)netvision.net.il

Buy a domain name - Register cheap domain names from $0.99 - Namecheap

Scalable Hosting That Grows With You

Secure & Reliable Web Hosting, Free Domain, Free SSL, 1-Click WordPress Install, Expert 24/7 Support

Semrush - keyword research tool

Boost your online presence with premium web hosting and servers

Disclosure: My content contains affiliate links.

39,933 questions

51,870 answers

573 users

How to multiply two lists in Python

3 Answers

0 votes
list1 = [1, 4, 6, 0, 9, 2]
list2 = [3, 7, 8, 5, 1, 4]

multiply = [x*y for x,y in zip(list1, list2)]

print(multiply)



'''
run:

[3, 28, 48, 0, 9, 8]

'''

 



answered Apr 18, 2021 by avibootz
0 votes
import numpy as np

list1 = [1, 4, 6, 0, 9, 2]
list2 = [3, 7, 8, 5, 1, 4]

multiply = np.multiply(list1, list2)

print(multiply)



'''
run:

[ 3 28 48  0  9  8]

'''

 



answered Apr 18, 2021 by avibootz
0 votes
list1 = [1, 4, 6, 0, 9, 2]
list2 = [3, 7, 8, 5, 1, 4]
 
multiply = list(map(lambda x,y: x*y ,list1, list2))
 
print(multiply)
 
 
 
'''
run:
 
[3, 28, 48, 0, 9, 8]
 
'''

 



answered Apr 18, 2021 by avibootz

Related questions

3 answers 165 views
165 views asked Apr 18, 2021 by avibootz
1 answer 195 views
1 answer 207 views
1 answer 126 views
126 views asked Feb 27, 2019 by avibootz
1 answer 70 views
1 answer 129 views
129 views asked Apr 11, 2019 by avibootz
...