Using the IDLE development environment, create a Python script named tryme4.py. (Note: an alternative to IDLE is to use a free account on the pythonanywhere website: ) IDLE has both an interactive mode and a script mode. You must use the script mode to develop your script. Your script must use meaningful variable names and have comments that describe what is happening in your script. Comments may describe the assignment of a value to a variable, a computation and the assignment of the result to a variable, or the display of the result. 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()   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 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 your instructor to assess. A placeholder can be output such as “Printing nine lines” or “Calling clearScreen()”. Good luck coding your first program!

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

Using the IDLE development environment, create a Python script named tryme4.py. (Note: an alternative to IDLE is to use a free account on the pythonanywhere website: )

IDLE has both an interactive mode and a script mode. You must use the script mode to develop your script. Your script must use meaningful variable names and have comments that describe what is happening in your script. Comments may describe the assignment of a value to a variable, a computation and the assignment of the result to a variable, or the display of the result.

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()

 

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 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 your instructor to assess. A placeholder can be output such as “Printing nine lines” or “Calling clearScreen()”.

Good luck coding your first program!

Expert Solution
Step 1

The source code of the program

def new_line():
    print('.')

def three_lines():
    new_line()
    new_line()
    new_line()

def nine_lines():
    three_lines()
    three_lines()
    three_lines()

def clearScreen():
    print('Printing nine lines')
    nine_lines()
    print('Printing nine lines')
    nine_lines()
    print('Printing three lines')
    three_lines()
    print('Printing three lines')
    three_lines()
    print('Printing new line')
    new_line()

print('Line from main function')
print('Calling clearScreen function')
clearScreen()

 

trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps with 2 images

Blurred answer
Knowledge Booster
Linux
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education