helloworld: (Default)
[personal profile] helloworld
This is where you can really tell the writers are not biologists. Or went through QC. It took me 30 minutes to figure out that the first month the rabbits are not breeding.

(I still hate recursion as much as before, but I managed to code up the (wrong) solution pretty quickly, so, I suppose I've made a modicum of progress?)

And one day when I am less lazy I will go in and actually ... put in the indents ...



n, k = [int(x) for x in input("Enter n and k separated by a comma: ").split(',')]

def fib(n):
if n > 2:
return fib(n-1) + k*fib(n-2)
if n == 2:
return 1
if n == 1:
return 1
return n

print(fib(n))
This account has disabled anonymous posting.
If you don't have an account you can create one now.
HTML doesn't work in the subject.
More info about formatting

Profile

helloworld: (Default)
apply(myLife, fuck)

October 2015

S M T W T F S
    123
4 5678910
11121314151617
18192021222324
25262728293031

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags