On 08/02/2014 10:06, rakesh sharma wrote:

Please do not top post on this list.

I got my definition wrong

the code should be more like this

def fib(n):
if n==0:
return

What does the above line return? As others have already said what happens if n is negative?

elif n==1:
return 1
elif n==2:
return 1
else:
return fib(n-2) + fib(n-1)

thanks,
rakesh


--
My fellow Pythonistas, ask not what our language can do for you, ask what you can do for our language.

Mark Lawrence

---
This email is free from viruses and malware because avast! Antivirus protection 
is active.
http://www.avast.com


_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor

Reply via email to