Python Forum
Python 3.5.1 DID NOT GIVE ME THE OUTPUT
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Python 3.5.1 DID NOT GIVE ME THE OUTPUT
#1
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")
Reply
#2
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()
Reply
#3
Thank you a lot for helping! I will try if I will get it right.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Python with Finance - i have no code but don't do it for me give me tips please Akainu 1 2,463 May-30-2019, 07:57 PM
Last Post: nilamo

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020