- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpascal.py
More file actions
Latest commit
25 lines (23 loc) · 504 Bytes
/
Copy pathpascal.py
File metadata and controls
25 lines (23 loc) · 504 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
importmath
n=int(input())
ans= []
foriinrange(0, n+1):
l= []
forjinrange(0, i+1):
a=math.factorial(i)
b=math.factorial(j)
c=math.factorial(i-j)
e=a//int(b*c)
l.append(e)
ans.append(l)
# Display
x=n
foreachinans:
string=''
foreleineach:
string=string+str(ele)+' '
forjinrange(x, 0, -1):
string=' '+string
x=x-1
string.strip()
print(string)