Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

pascal triangle python

def printPascal(n):  
  
    for i in range(1,n + 1):  
        m = 1;  
        for j in range(1,i + 1):
            print(m, end = " ")
            m = int(m * (i - j) / j)  
        print("")
          
printPascal(int(input()))

#code by fawlid
 
PREVIOUS NEXT
Tagged: #pascal #triangle #python
ADD COMMENT
Topic
Name
1+4 =