Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Using the IDLE development environment, create a Python script named tryme3.py .

ID: 3829980 • Letter: U

Question

Using the IDLE development environment, create a Python script named tryme3.py . Write a function in this file called nine_lines that uses a function called three_lines to print nine blank lines. Now add a function named clear_screen that prints out twenty-five blank lines. The last line of your program should call the function to clear_screen .

The function three_lines and new_line are defined below so that you can see a nested function call.

def new_line():

print()

def three_lines():

new_line()

new_line()

new_line()

Submit your Python script file in the posting of your assignment. Your Python script should be either a .txt file or a .py file. You must execute your script and copy and paste the output produced into a document that you will submit along with your python script. It is very helpful if you print a placeholder between the printing of 9 lines and the printing of 25 lines. It will make your output easier to read for the assessor. A placeholder can be a comment such as “now printing 9 lines” or “now printing 25 lines”.

You can submit the document as a Word 2003, or OpenOffice document. Open Office documents should be saved using with Word format and NOT the default format used by OpenOffice writer. (the file extension will be .doc.)

Don’t forget to use comments in your script file to make the script more readable.

Explanation / Answer

new_line():
print()

def three_lines():
new_line()
new_line()
new_line()
def nine_lines():
print("Now Calling three_lines function...")
print three_lines()
  
def three_lines():
print("printing line one")
print("printing line two")
print("printing line three")
print("printing line four")
print("printing line five")
print("printing line six")
print("printing line seven")
print("printing line eight")
print("printing line nine")
  
print three_lines()

def clear_screen():
print("Now Clearing screen...from screen_line function")
print("printing line one from clear screen")
print("printing line two from clear screen")
print("printing line three from clear screen")
print("printing line four from clear screen")
print("printing line five from clear screen")
print("printing line six from clear screen")
print("printing line seven from clear screen")
print("printing line eight from clear screen")
print("printing line nine from clear screen")
print("printing line ten from clear screen")
print("printing line eleven from clear screen")
print("printing line twelve from clear screen")
print("printing line thirteen from clear screen")
print("printing line fourteen from clear screen")
print("printing line fifteen from clear screen")
print("printing line sixteen from clear screen")
print("printing line seventeen from clear screen")
print("printing line eighteen from clear screen")
print("printing line nineteen from clear screen")
print("printing line twenty from clear screen")
print("printing line twenty one from clear screen")
print("printing line twenty two from clear screen")
print("printing line twenty three from clear screen")
print("printing line twenty four from clear screen")
print("printing line twenty five from clear screen")

print clear_screen()

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote