Python sum of non duplicate int
问题 I am given 3 int, a, b, c. I would like to find the sum of all three int provided that they are unique. If a, b, or c has the same values as any of the other values, then they don't count towards the sum. Example 1: a = 3, b = 3, c =3 sum = 0 Example 2 a = 1, b = 3, c =3 sum = 1 This is what I have done. Is there a more pythonic way of doing this without so many if else statements? def lone_sum(a, b, c): if a != b and b != c and a != c: return a + b + c elif a == b == c: return 0 elif a == b: