Skip to content

Instantly share code, notes, and snippets.

@gagangowda
Created October 8, 2013 06:41
Show Gist options
  • Select an option

  • Save gagangowda/6880492 to your computer and use it in GitHub Desktop.

Select an option

Save gagangowda/6880492 to your computer and use it in GitHub Desktop.
Pascal Tree
def triangle(rows):
for rownum in range (rows):
newValue=1
PrintingList = [newValue]
for iteration in range (rownum):
newValue = newValue * ( rownum-iteration ) / ( iteration + 1 )
PrintingList.append(int(newValue))
print(PrintingList)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment