0
Something wrong
def f(x): if x==1: return 1 continue elif x==3: return 3 elif x%2==0: x=x/2 return f(x) elif x%4==1: a = (x+1)/2 b = (x-1)/4 x ==2*f(a)-f(b) return f(x) print (f(5)) is
2 Answers
+ 3
What kind of problem do you have? Which error message do you get?
+ 3
You can't use continue outside of a loop. Also, your indentation is off. Every elif has to be just as much indented as the corresponding if. And every statement in a block of code has to have the same indentation too. Your second to last line in the function is arbitrarily more indented than the rest. You can't do that in Python