Question: Write a Python program to print Pascals triangle for a certain number of rows. Define a function called printTriangle to print the Pascals Triangle with
Write a Python program to print Pascals triangle for a certain number of rows. Define a function called printTriangle to print the Pascals Triangle with row number of rows. In main, read an integer N from the user, call the printTriangle function to print the Pascals Triangle.
Pascals Triangle is an arithmetic and geometric figure first imagined by Blaise Pascal. To build the triangle, start with 1 at the top, then continue placing numbers below it in a triangular pattern. Each number is the numbers directly above it added together. It is usually written with the rows staggered like in the picture below.

Also, you can assume the number entered will be at least 3. You can also just print the triangle like the sample run below:

1 21 1 3 3 1 14 6 4 1
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
