Programming Assign.
Unit 2
University of the People
CS 1101: PROGRAMMING FUNDAMENTALS
Damian Kravets, Instructor
June 30, 2021
Input :
# First function definition
def new_line(): # Printing one new line
print('.')
# Second function definition
def three_lines(): # Printing three new lines using the first function named new_line three
times
new_line()
new_line()
new_line()
# Third function definition
def nine_lines(): # Printing nine new lines using the second function named three_lines three
times
three_lines()
three_lines()
three_lines()
# Fourth function definition
def clear_screen(): # printing twenty-five new lines with the combination of the three
functions nine_lines, three_lines, and new_line
nine_lines()
nine_lines()
three_lines()
three_lines()
new_line()
# It’s a simple numerical reasoning since 25 = 9 + 9 + 3 + 3 + 1
# Finally, calling the functions we used above to do the program
# Also, printing a placeholder between the printing of 9 lines and the printing of 25 lines
print('Printing nine lines') # This is to get a placeholder in the output
nine_lines()
print('Printing twenty-five lines') # This is also to get the second placeholder in the output
clear_screen()
Output :
#Print 9 "." lines
Printing nine lines
.
.
.
.
.
.
.
.
.
#Print 25 "." lines
Printing twenty-five lines
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
>>>