Question: Python - give a recursive function. Paramter must be n - a number. def print_ruler (n) This function is given a positive integer n, and

Python - give a recursive function. Paramter must be n - a number.

Python - give a recursive function. Paramter must be n - a

number. def print_ruler (n) This function is given a positive integer n,

def print_ruler (n) This function is given a positive integer n, and prints a vertical ruler of 21 - 1 ines. Each line contains '-' marks as follows: The line in the middle () of the ruler contains n '-'marks The lines at the middle of each half Gand) of the ruler contains (n-1)'-' marks The lines at theand^of the ruler contains (n-2) -'marks . And so on The lines at theof the ruler contains 1 mark 2K-1 2k' 2k' 2k

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 Databases Questions!