Last active
August 29, 2015 14:16
-
-
Save lmaresz/885c840d4a2fa1a876b5 to your computer and use it in GitHub Desktop.
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 faktorialis (a): | |
s = 1 | |
for szam in range(1,a+1): | |
s = s*szam | |
return s | |
a = int(input ("szam:")) | |
def pascalharomszog (i): | |
for n in range(i): | |
s = "" | |
for k in range (n+1): | |
e = faktorialis(n) | |
f = faktorialis(n-k) | |
g = faktorialis(k) | |
s = s + str(int((e/(f*g))))+" " | |
print (s.center(950," ")) | |
pascalharomszog(a) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment