I couldn't decide if the following function is iterative or recursive,
I think it's recursive because it repeats itself, but since it has a while loop I have doubts,
def function(n):
while((n!=1) and (n!=0)):
return function(n-1) + function(n-2)
return n
function
calls itself. That's the definition of recursion. Also see my comment. – rantanplan Oct 28 '12 at 1:41