115. Python Program to Print Number Triangle.
How does this program work?
- This program is used to print Number Triangle using Python.
Here is the code
n = int(input( "Enter the number of rows: "))
nst = 1
for i in range(0,n):
num = 1
for j in range(1,n-i):
print(" ", end=" ")
for j in range(0,nst):
print(num, end=" ")
print(" ", end=" ")
num = int((num*(i-j))/(j+1))
nst = nst+1
j= j+1
print(" ")