Create a variable total of type Double set to 0. Then loop through the dictionary, and add the value of each integer and double to your variable's value. For each string value, add 1 to the total. For each boolean, add 2 to the total if the boolean is true, or subtract 3 if it's false. Print the value of total.

Respuesta :

Answer:

total = 0.0

for x in dictionary.values():

   if x == str(x):

       total += 1

   elif x is bool:

       total += 2 if x is True else total -3

   else:

       total += x

print( total )

Explanation:

The python source code defines a variable 'total' and iterates through a dictionary and adds its values to the total variable. Finally, the total value is printed.