Last active
October 16, 2021 18:43
-
-
Save naemazam/734c0320f53df66af256f0f4144a2641 to your computer and use it in GitHub Desktop.
Yang Hui triangle is also look like Pascal triangle
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 fact(n): | |
azam=1 | |
for c in range(1,n+1): | |
azam = azam*c | |
return azam | |
rows = int(input("Enter how many row you want to see :\n ")) | |
for i in range(0, rows): | |
for j in range(1, rows-i): | |
print(" ", end="") | |
for k in range(0, i+1): | |
azam = int(fact(i)/(fact(k)*fact(i-k))) | |
print(" ", azam, end="") | |
print() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment