Question: 01. Write a Python function with the following prototype: def drawTriangle(rows) This function accepts a number from 1 to 10 inclusive and draws a number

01. Write a Python function with the following prototype: def drawTriangle(rows) This function accepts a number from 1 to 10 inclusive and draws a number pyramid with the first row starting at 0. Subsequent rows contain 2 more numbers than the previous row such that the middle number in each row increases by 1. Also, each row begins with a and increases by 1 for each column until the middle number is reached at which point, the numbers decrease until they end with o. Also, each row displays spaces so that the pyramid appears as an isoscelles triangle. The first row will contain row - 1 spaces, the second row will contain row - 2 spaces, etc. # For example, when rows = 3 the pyramid looks like: 0 010 01210 # For example, when rows = 10 the pyramid looks like: 0 010 01210 0123210 012343210 01234543210 0123456543210 012345676543210 01234567876543210 0123456789876543210
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
