Answered step by step
Verified Expert Solution
Link Copied!

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.

image text in transcribed

image text in transcribed

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Excel As Your Database

Authors: Paul Cornell

1st Edition

1590597516, 978-1590597514

More Books

Students also viewed these Databases questions

Question

What are the purposes for closing the books?

Answered: 1 week ago

Question

1. Select the job or jobs to be analyzed.

Answered: 1 week ago