May-06-2018, 08:48 AM
I was given the below assignment but I do not know how should I go about to get an output. How should I print a placeholder between the printing of 9 lines and the printing of 25 lines?
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 following is what I did and gave me no result.
>>> def new_line(): # a print statement with no arguments prints a new line
print() # empty parentheses indicate that it has no parameters
>>> def three_lines(): # three_lines calls new_lines
new_lines()
new_lines()
new_lines()
>>> def nine_lines(): # nine_lines calls three_lines
three_lines()
three_lines()
three_lines()
print("First Line.") # print function's parenthesis has arguments
print("now nine blank lines...")
nine_lines()
print("Second Line.")
>>> def clear_screen():
nine_lines()
nine_lines()
three_lines()
three_lines()
new_line()
print("Line 1")
print("now twenty-five blank lines...")
clear_screen()
print("last line")
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 following is what I did and gave me no result.
>>> def new_line(): # a print statement with no arguments prints a new line
print() # empty parentheses indicate that it has no parameters
>>> def three_lines(): # three_lines calls new_lines
new_lines()
new_lines()
new_lines()
>>> def nine_lines(): # nine_lines calls three_lines
three_lines()
three_lines()
three_lines()
print("First Line.") # print function's parenthesis has arguments
print("now nine blank lines...")
nine_lines()
print("Second Line.")
>>> def clear_screen():
nine_lines()
nine_lines()
three_lines()
three_lines()
new_line()
print("Line 1")
print("now twenty-five blank lines...")
clear_screen()
print("last line")