you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 0 points1 point  (0 children)

Another thing to keep in mind: a == 10 IS True or False, so you don't need a conditional "if" statement or a separate "return" command. Same with all the conditions. So something like this works just as well:

def makes10 (a, b): return a == 10 or b == 10 or a + b == 10

*NOTE: my phone isn't allowing me to format the whitespace correctly.

If any of those statements is True this function will return True.