Skip to content

Instantly share code, notes, and snippets.

@craftbyte
Created June 9, 2016 07:39
Show Gist options
  • Save craftbyte/0b183c08d8af7f9931161981ce2db129 to your computer and use it in GitHub Desktop.
Save craftbyte/0b183c08d8af7f9931161981ce2db129 to your computer and use it in GitHub Desktop.
Pascalov trikotnik
def triangle(vrstice):
for stVrstice in range (vrstice):
vrednost=1
vrstica = [vrednost]
for clen in range (stVrstice):
vrednost = vrednost * ( stVrstice-clen ) * 1 / ( clen + 1 )
vrstica.append(int(vrednost))
print(vrstica)
print()
triangle(int(input('lolek:')))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment