PY
py
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
26
27
28
import sys
"""
[CHALLANGE] Pascal Triangle
Input(number of rows) = 6
output:
1
1 1
1 2 1
1 3 3 1
1 4 6 4 1
1 5 10 10 5 1
Create a program which will make such triangle
1>Using Arrays
2>Without using Arrays
Good Luck :)
"""
rows = int(input("Enter the number of rows:\n"))
print(str(rows)+" rows")
def combination(x,r):
return fact(x)/(fact(x-r)*fact(r))
def fact(x):
if x==0 or x==1:
return 1
else:
Enter to Rename, Shift+Enter to Preview
OUTPUT
Run