Skip to content

* Make the fibonacci solution more pythonic#4

Closed
semk wants to merge 1 commit into
mjhea0:masterfrom
semk:master
Closed

* Make the fibonacci solution more pythonic#4
semk wants to merge 1 commit into
mjhea0:masterfrom
semk:master

Conversation

@semk

@semk semk commented Feb 23, 2014

Copy link
Copy Markdown

From Python 2.5 onwards we can have conditionals like this. I think its more pythonic.

def fib(n):
    return n if n < 2 else fib(n-1) + fib(n-2)

@rafaelcanovas

Copy link
Copy Markdown

I was about to open an issue about this, a bit unfair with Python, I agree.

@mjhea0

mjhea0 commented Apr 27, 2014

Copy link
Copy Markdown
Owner

updated the readme to include this code, just in a little different manner

@mjhea0 mjhea0 closed this Apr 27, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants