Functions : Nth Fibonacci Function

In this video , why the code is being runned from i=1 to i=n-1 and not i=1 to i=n-2 . since it is a fibonacci sequence and 0 & are 1st and 2nd number of the sequence so to find the Nth number the loop should run from i=1 to i=nth no. - 2??

Hi @Maazkhan, its general convention to consider 1 as first fibonacci number not 0 , in case 0 is considered as 1st fibb number then it will be mentioned so accordingly make change in your code . here in the vedio we have considered 1 as first fibb number

In case of any doubt feel free to ask :slight_smile:
If you got the answer then mark your doubt as resolved

1 Like

ok, got it . Thank you

great !! mark your doubt as resolved if you have no further query

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.

It ain’t appearing in ‘My doubts’ section . How do i mark it resolve then?