Note: the solutions using combinations above are better!
But I'll keep this anyway.
from itertools import permutations
data = {'a': 10, 'b': 20, 'c':30}
for key_perm in permutations(data.keys(), 2):
print ' + '.join(key_perm), '=', sum(data[k] for k in key_perm)
Prints:
a + c = 40
a + b = 30
c + a = 40
c + b = 50
b + a = 30
b + c = 50
But probably you want only distinct sums, since addition of integers is commutative. Sets come to the rescue.
for key_perm in set(tuple(sorted(perm)) for perm in permutations(data.keys(), 2)):
print ' + '.join(key_perm), '=', sum(data[k] for k in key_perm)
Prints:
b + c = 50
a + b = 30
a + c = 40
The use of tuple above is needed because set() only takes immutable items, and sorted() returns a mutable list.