You will build a row of Pascal's triangle by adding neighbours, build it again from the formula, and check that each row adds up to a power of . The checker tests rows to .
The idea. Each new row starts with , then holds the sums of neighbouring numbers of the row above, and ends with . The formula gives the same row: .
Your tasks.
row_by_adding(n). Start from the row [1] and build one row at a time.row_by_formula(n). Use comb(n, k) for each k.row_sum(n). Add the numbers in row n.Have you tried it?
Do the tasks in the editor first, and run the checker after each one. Its hints help when a check fails. When you are ready, compare your code with this solution.
Log in to join the discussion.
Loading…
With Standard, you also open 11 more problems, 2 Python labs and 1 extra course. Everything you have used here stays free, always.