in generalan interval with central tick length > is composed ofan interval with central tick length single tick of length an interval with central tick length although it is possible to draw such ruler using an iterative process (see exercise - )the task is considerably easier to accomplish with recursion our implementation consists of three functionsas shown in code fragment the main functiondraw rulermanages the construction of the entire ruler its arguments specify the total number of inches in the ruler and the major tick length the utility functiondraw linedraws single tick with specified number of dashes (and an optional string labelthat is printed after the tickthe interesting work is done by the recursive draw interval function this function draws the sequence of minor ticks within some intervalbased upon the length of the interval' central tick we rely on the intuition shown at the top of this pageand with base case when that draws nothing for > the first and last steps are performed by recursively calling draw interval( the middle step is performed by calling the function draw line( def draw line(tick lengthtick label) """draw one line with given tick length (followed by optional label""tick length line if tick labeltick label line + print(line def draw interval(center length) """draw tick interval based upon central tick length ""stop when length drops to if center length recursively draw top ticks draw interval(center length draw center tick draw line(center lengthrecursively draw bottom ticks draw interval(center length def draw ruler(num inchesmajor length) """draw english ruler with given number of inchesmajor tick length ""draw inch line draw line(major length for in range( num inches)draw interior ticks for inch draw interval(major length draw inch line and label draw line(major lengthstr( )code fragment recursive implementation of function that draws ruler