In a fruitful function, it is a good idea to ensure that every possible path through the program hits a return statement. For example: def absolute_value(x): if x < 0: return -x if x > 0: return x This function