xxxxxxxxxx
my_dict = {'data1':100,'data2':-54,'data3':247}
print(sum(my_dict.values()))
xxxxxxxxxx
def sum_summables(dictionary):
total = 0
for value in dictionary.values():
if isinstance(value, (int, float)):
total += value
elif isinstance(value, str):
total += float(value)
return total
xxxxxxxxxx
def sum_summables(dictionary):
total = 0
for v in dictionary.values():
if (isinstance(v, int) or isinstance(v, float)):
total += v
elif v.isnumeric():
total += float(v)
return total