Write a Python3 program that prints a index wise product of a Dictionary of Tuple Values


Topic: Write a Python3 program that prints a index wise product of a Dictionary of Tuple Values

Solution

test_dict = {'END Program' : (5, 6, 1), 'is' : (8, 3, 2), 'best' : (1, 4, 9)}
prod_list=[]
for x in zip(*test_dict.values()):
  res = 1 
  for ele in x: 
      res *= ele
  prod_list.append(res)
res = tuple(prod_list) 
print("The product from each index is : " + str(res))



List all Python Programs