Week 4 Unit 3: Self-test

22. October 2024

Question 1

Which of the following statements about line breaks are correct?

Note: There are 3 correct answers to this question.


From the computer's point of view, the line break is nothing but the special character "\n". This character forces the editor to go to the next line.
If there are two line breaks "\n\n", the program goes into the next line twice and an empty line is created. To have two empty lines, four line breaks "\n\n\n\n" are required.
The line break "\n" is put at the end of each "print()" statement if the "end" parameter is not explicitly set to another value.
The line break "\n" cannot be used in strings to format the output.
As there is a line break "\n" in standard text files at the end of each line and another line break "\n" is added by the "print()" statement, this can lead to additional empty lines when outputting the file.

< Previous unit | Next unit > | Course Overview