0% found this document useful (0 votes)
25 views

Programming Assignment Unit 2

Uploaded by

insta grain
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
25 views

Programming Assignment Unit 2

Uploaded by

insta grain
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 4

Assignment

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.

def new_line():
print('.')

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

def nine_lines(): #function called three_lines() to print a total of


nine lines.
three_lines()
three_lines()
three_lines()

print("Printing 9 Lines")#Placeholder in between

nine_lines()

def clear_screen(): #function called to print a total twenty-five


lines..
nine_lines()
nine_lines()
three_lines()
three_lines()
new_line()

print("Printing 25 Lines")#Placeholder in between

clear_screen()

print('The END....')
"C:\Users\OnePlug Tech\PycharmProjects\tryme4.py\tryme4.py"
Printing 9 Lines
.
.
.
.
.
.
.
.
.
Printing 25 Lines
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
The END....

Process finished with exit code 0


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?

Yes it implements new_line, three_lines, nine_lines, and


clear_screen functions.

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

Yes the assignment demonstrates 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.

Yes the assignment produces the appropriate output when executed.

● Does the program code include comments where appropriate?

Yes the program code include comments where appropriate.

You might also like