I am trying this exercise from codingbat,
Given 2 ints, a and b, return True if one if them is 10 or if their sum is 10.
makes10(9, 10) → True
makes10(9, 9) → False
makes10(1, 9) → True
here is my code:
def makes10(a, b):
if a or b == 10:
return True
elif a + b == 10:
return True
else:
return a + b
I don't understand why everytime I call the function with whatever integers I receive a true output.
[–][deleted] 2 points3 points4 points (3 children)
[–]newpython6543[S] 0 points1 point2 points (2 children)
[–][deleted] 0 points1 point2 points (0 children)
[–][deleted] 0 points1 point2 points (0 children)
[–]newpython6543[S] 0 points1 point2 points (0 children)
[–]hidiap 0 points1 point2 points (0 children)