New to coding and haven't encountered this type of return ant keep getting this error. I can only edit the 'f =' variable.
def a_plus_abs_b(a, b):
"""Return a+abs(b), but without calling abs.
>>> a_plus_abs_b(2, 3)
5
>>> a_plus_abs_b(2, -3)
5
"""
if b < 0:
f = (-1)*b + a
else:
f = (a+b)
return f(a, b)
return f. return f(a, b) is trying to call the function f with arguments a, b. But, f is not a function but the value you calculated. P.S. This is more simpler done withreturn a + abs(b)which uses the abs function.