Python3 code to demonstrate
Matrix Product
Using chain() + loop
from itertools import chain
getting Product
def prod(val):
res = 1
for ele in val:
res *= ele
return res
initializing list
test_list = [[1, 4, 5], [7, 3], [4], [46, 7, 3]]
printing original list
print("The original list : " + str(test_list))
using chain() + loop
Matrix Product
res = prod(list(chain(*test_list)))
print result
print("The total element product in lists is : " + str(res))
Output :
The original list : [[1, 4, 5], [7, 3], [4], [46, 7, 3]]
The total element product in lists is : 1622880
On this page of the site you can watch the video online Python Program # Python3 code to demonstrate# Matrix Product# Using chain() + loop with a duration of hours minute second in good quality, which was uploaded by the user Tech Tips 06 November 2022, share the link with friends and acquaintances, this video has already been watched 9 times on youtube and it was liked by 0 viewers. Enjoy your viewing!