152k views
3 votes
Here is source code of the Python Program to multiply all the items in a dictionary. The program output is also shown below.d={'A':10,'B':10,'C':239}tot=1for i in d: tot=tot*d[i]print(tot)

User Facundo
by
5.3k points

1 Answer

2 votes

Answer:

Following are the output to this question:

Output:

23900

please find the code in the attachment file.

Step-by-step explanation:

In the above-given Python code, a dictionary "d" is defined, that holds key and values, in the next step, the "tot" an integer variable is defined, that holds a value "1".

In the next step, for loop is defined, that uses the "tot" variable to multiply the dictionary value and store its value.

Outside the loop, the print method is used, that prints its values.

Here is source code of the Python Program to multiply all the items in a dictionary-example-1
User Harph
by
5.2k points