Created
June 9, 2016 07:39
-
-
Save craftbyte/0b183c08d8af7f9931161981ce2db129 to your computer and use it in GitHub Desktop.
Pascalov trikotnik
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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