Skip to content

Instantly share code, notes, and snippets.

@thisiswei
Last active December 12, 2015 07:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save thisiswei/4736325 to your computer and use it in GitHub Desktop.
Save thisiswei/4736325 to your computer and use it in GitHub Desktop.
def pascal(n):
if n == 1:
return [1]
else:
x = pascal(n-1)
return [1] + [x[i]+x[i-1] for i in range(1,len(x))] + [1]
" seems like learning functional language is helpful :) "
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment