Computer Science, asked by allysia, 3 months ago

Print a pascal's triangle for n rows.

Language Python.

Answers

Answered by Anonymous
0

Pascal's Triangle in Python | Python Program to Print Pascal's...

  1. INPUT FORMAT: Input consists of an integer.
  2. OUTPUT FORMAT: Refer sample output.
  3. SAMPLE INPUT: 3.
  4. SAMPLE OUTPUT: 1 1 1 1 2 1. ...
  5. Step 2: Using a for loop which ranges from 0 to n-1, append the sub-lists into the list.
  6. Step 4: Then use a for loop to determine the value of the number inside the triangle.
  7. Step 6: Exit. ...
  8. Input:

 \\  \\  \\

Answered by RahulNaik20
0

Python Program to Print the Pascal's triangle for n number of rows given by the user

  1. Take in the number of rows the triangle should have and store it in a separate variable.
  2. Using a for loop which ranges from 0 to n-1, append the sub-lists into the list.
  3. Then append 1 into the sub-lists.

Explanation:

Here is your answer.

Thank you

Similar questions