Question: Q-2 [40 pts] Write a Python function printline(numblanks, numsymns, sym) that takes integers numblanks and numsyms, and a symbol sym as parameters. The function will

Q-2 [40 pts] Write a Python function printline(numblanks, numsymns, sym) that takes integers numblanks and numsyms, and a symbol sym as parameters. The function will print a line with numblanks blanks followed by the symbol sym repeated numsyms times. For example the call printline(5, 10, '*' ) will print the pattern below: ********** [Note: The '' symbol is not part of the output; it is only shown here to indicate the start of the line.] Next, write a Python function printrectangle(length, height, sym) that prints height lines, each with sym repeated length times. You are required to call the function printline() above for printing each line. For example the call printrectangle(8, 3, '*' ) will print the pattern below: * *** ** ** ******* * * ** * * * * * Finally, write a Python function printtriangle(size, sym) that prints a right-angled triangle of length and height size as illustrated below. You are required to call the function printline() above for printing each line. For example the call printtriangle(5, '*' ) will print the pattern below: * * ** * * * *** * Save Run Show CodeLens Original - 1 of 1 1# Write your program here 2

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Mathematics Questions!