Funnction Name: lone_sum
Parameters a : an integer value b : an integer value c : an integer value
Given 3 integer values, a, b, c, return their sum. However, if one of the values is the same as another of the values, it does not count towards the sum.
Return Value: The sum of a, b, and c, leaving out like values.
I have this and I'm completely lost with it! What am I missing?
def lone_sum(a,b,c):
t=0
if a!=b and b!=c:
t=a+b+c
elif a==b and a!=c:
t= a+c
elif a==c and a!=b:
t=a+b
elif b==c and b!=a:
t=b+a
elif a==b and b==c:
t=0
return t
elifis not consistent with the others: if all 3 are equals according to the other "elifs" you are considering only one of the "dups" but in the last elif you don't consider any of them.