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() Assessment The following items will be used in the grading rubric for this assignment. Make sure that you have addressed each item in your assignment.   Does the assignment implement new_line, three_lines, nine_lines, and clear_screen functions, as well as a main section of the program which calls the functions? Does the assignment demonstrate the use of nested function calls? Does the assignment produce the appropriate output when executed? The output should be recorded in a text file, a Microsoft Word document, or an RTF-formatted document by copying the output from the Python script into the document. The successful script will print out 9 "." lines first and then 25 "." lines. Does the program code include comments where appropriate?

EBK JAVA PROGRAMMING
8th Edition
ISBN:9781305480537
Author:FARRELL
Publisher:FARRELL
Chapter16: Graphics
Section: Chapter Questions
Problem 2GZ
icon
Related questions
Question

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

Assessment

The following items will be used in the grading rubric for this assignment. Make sure that you have addressed each item in your assignment.

 

  • Does the assignment implement new_line, three_lines, nine_lines, and clear_screen functions, as well as a main section of the program which calls the functions?

  • Does the assignment demonstrate the use of nested function calls?

  • Does the assignment produce the appropriate output when executed? The output should be recorded in a text file, a Microsoft Word document, or an RTF-formatted document by copying the output from the Python script into the document. The successful script will print out 9 "." lines first and then 25 "." lines.

  • Does the program code include comments where appropriate?
Expert Solution
Step 1

Introduction

A function is a block of code that can accept inputs, perform operations on those inputs, and then return one or more values. Functions are a great way to structure and organize your code. In Python, functions are defined using the def keyword, followed by the name of the function, parentheses containing any parameters to be passed to the function, and a colon. The code block inside the function is then indented.

steps

Step by step

Solved in 4 steps with 2 images

Blurred answer
Knowledge Booster
Unreferenced Objects
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
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781305480537
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT