{"id":16542,"date":"2021-08-12T09:24:19","date_gmt":"2021-08-12T03:54:19","guid":{"rendered":"https:\/\/python-programs.com\/?p=16542"},"modified":"2021-11-22T18:38:33","modified_gmt":"2021-11-22T13:08:33","slug":"python-program-to-find-product-of-values-of-elements-in-a-dictionary","status":"publish","type":"post","link":"https:\/\/python-programs.com\/python-program-to-find-product-of-values-of-elements-in-a-dictionary\/","title":{"rendered":"Python Program to Find Product of Values of elements in a Dictionary"},"content":{"rendered":"

In the previous article, we have discussed Python Program to Check if a String is a keyword or Not<\/a>
\nDictionary in python :<\/strong><\/p>\n

A dictionary is a set of elements that have key-value pairs. The values in the elements are accessed using the element’s keys.<\/p>\n

example:<\/p>\n

dict = {‘january’ :1, ‘febrauary’: 2, ‘march’: 3 }<\/p>\n

Given a dictionary, and the task is to find the Product of values of elements in a dictionary.<\/p>\n

Examples:<\/strong><\/p>\n

Example1:<\/strong><\/p>\n

Input:<\/strong><\/p>\n

Given dictionary = {'jan': 10, 'Feb': 5, 'Mar': 22, 'April': 32, 'May': 6}<\/pre>\n

Output:<\/strong><\/p>\n

The Product of values in a given dictionary =  211200<\/pre>\n

Example2:<\/strong><\/p>\n

Input:\u00a0<\/strong><\/p>\n

Given dictionary = {'a': 1, 'b': 5, 'c': 2, 'd': 4, 'e': 7, 'f': 2}<\/pre>\n

Output:<\/strong><\/p>\n

The Product of values in a given dictionary =  560<\/pre>\n

Program to Find Product of Values of elements in a Dictionary<\/h2>\n

Below are the ways to Find the Product of Values of elements in a Dictionary.<\/p>\n