|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
HEY GUYS, please help me out,
i am trying to do some programming and im stuck now. i need to implement an iterative funtion in python so i can generate numbers in the fibonacci sequence. below is the the coding for it.fib(0) = 1 fib(1) = 1 fib(n) = fib(n − 1) + fib(n − 2) please can someone help me on how to implement it. appreciate it if anyone could answer my dilemma, Thanks. G X |
|
#2
|
||||
|
||||
|
--moved to the general Programming Help forum, although I
doubt you'll find Python programmer around here. you might have better luck in this forum. ![]() |
|
#3
|
||||
|
||||
|
Code:
fibonacci = lambda x:map(lambda o:(map(lambda c:map(lambda l:o.__setslice__(l[0],l[1],l[2]),([o[2]+3,o[2]+4,[o[0]]],[0,3,[o[1],reduce(lambda x,o:x+o,o[:2]),o[2]+1]])),range(x)),o)[1],[[1,1,0]+range(x)])[0][3:] print fibonacci(20)
__________________
Click the image if at any point you don't like my decision.Scripting problems? Windows questions? Ask the Windows Guru! |
![]() |
| Viewing: ASP Free Forums > Other > Programming Help > Please Help Me :( |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|