Skip to content

Instantly share code, notes, and snippets.

@lmaresz
Last active August 29, 2015 14:16
Show Gist options
  • Save lmaresz/885c840d4a2fa1a876b5 to your computer and use it in GitHub Desktop.
Save lmaresz/885c840d4a2fa1a876b5 to your computer and use it in GitHub Desktop.
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