Answer to Question #162878 in Python for Paul Carpenter

Question #162878

Write a function in this file called nine_lines that uses the function three_lines (provided below) to print a total of nine lines.

Now add a function named clear_screen that uses a combination of the functions nine_lines, three_lines, and new_line (provided below) to print a total of twenty-five lines. The last line of your program should call first nine_lines and then the clear_screen function.


The function three_lines and new_line are defined below so that you can see nested function calls. Also, to make counting “blank” lines visually easier, the print command inside new_line will print a dot at the beginning of the line:


def new_line():


print('.')


def three_lines():


new_line()


new_line()


new_line()


1
Expert's answer
2021-02-11T04:21:37-0500

def new_line():

  print('')


def three_lines():

  new_line()

  new_line()

  new_line()


def nine_lines():

  three_lines()

  three_lines()

  three_lines()

   

def clear_screen():

  nine_lines()

  three_lines()

  new_line()


   

   


print('.')

new_line()

print('.')

three_lines()

print('.')

nine_lines()

print('.')

clear_screen()



Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

ashweb
15.09.21, 11:32

You saved a day... You are the best

Leave a comment

LATEST TUTORIALS
APPROVED BY CLIENTS