Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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.
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' 2kStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started