Print a pascal's triangle for n rows.
Language Python.
Answers
Answered by
0
Pascal's Triangle in Python | Python Program to Print Pascal's...
- INPUT FORMAT: Input consists of an integer.
- OUTPUT FORMAT: Refer sample output.
- SAMPLE INPUT: 3.
- SAMPLE OUTPUT: 1 1 1 1 2 1. ...
- Step 2: Using a for loop which ranges from 0 to n-1, append the sub-lists into the list.
- Step 4: Then use a for loop to determine the value of the number inside the triangle.
- Step 6: Exit. ...
- Input:
Answered by
0
Python Program to Print the Pascal's triangle for n number of rows given by the user
- Take in the number of rows the triangle should have and store it in a separate variable.
- Using a for loop which ranges from 0 to n-1, append the sub-lists into the list.
- Then append 1 into the sub-lists.
Explanation:
Here is your answer.
Thank you
Similar questions