Question: python 3please Question 5: Pascal Triangle (4 points) The tollowing figure shows the first few rows of a graphic known as Pascal's triangle 1 5
Question 5: Pascal Triangle (4 points) The tollowing figure shows the first few rows of a graphic known as Pascal's triangle 1 5 10 105 1 1 12 15 61 The triangle may be constructed in the following manner: In row O (the topmost sow), there is a unique nonzero entry 1. Each entry of each subsequent row is constructed by adding the number above and to the left with the number above and to the right, treating blank entries as 0. For example, the invitial number in the first (or any othern row is 1 (the sum of O and 1), whereas the numbers 1 and 3 in the third row are added to produce the number 4 in the fourth row See Write a function pascal triangle(n) that takes as input a non-negative integer n and returns the nth row of Pascairs triange as a list. See the test cases for examples def pascal triangle(nj ancal's triangle for details In ( IYour code here In (1s pascal triangle(S)-11, 5,10, 10, 5, 1 pascal triangle(10)--, 10, 45, 120, 210, 252, 210, 120, 45, 10, 11 pascal triangle(5)1, 15, 103, 455, 3365, 3003, 5003, 6435, 6435, 5005, 3003, 1365, 455, 105, 15, 1 pascal-triangle(71)--[1. M In I In I 71. 2485. 57155, 971635, 13019909, 143218999, 1329890705, 10639125640, 74473873480, 4617 (*)I
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
