Skip to content

Instantly share code, notes, and snippets.

@sakadonohito
Created December 8, 2013 13:24
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sakadonohito/7857478 to your computer and use it in GitHub Desktop.
Save sakadonohito/7857478 to your computer and use it in GitHub Desktop.
pythonでパスカルの三角形
#!/usr/bin/python
if __name__ == '__main__':
num = raw_input()
num = int(num) if num else 10
l = [1]
print l
for i in range(num):
l = map(lambda x,y:x+y,[0]+l,l+[0])
print l
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment