Python Forum

Full Version: Python 3.5.1 DID NOT GIVE ME THE OUTPUT
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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")
Please use the [python] [/python] around your code or all the indent is lost... and do not abuse of caps in the subject.

From the description of your homework, the output I expect is:
Output:
~/homeworks> python3 tryme3.py ... 25 empty lines ... ~/homeworks>
If you read it carefully you must write 3 functions (three_lines, nine_lines, clear_screen) and call just the last one... and I think you have it with just removing the extra print("First line:") and similar and the unneeded call to nine_lines()
Thank you a lot for helping! I will try if I will get it right.