← Back to Strings
Question 7
Newline Inside A String
Newline Inside A String
The two-character escape \n inside a string stands for a line break, so one print call can produce two lines. Build message as a single f-string that reads Dear, a space, the stored name, a comma, a line break, then the sentence See you Monday. and print it; the output is two lines, the greeting then the sentence. No input is read.
Expected Output:
Dear Giselle, See you Monday.
= newline. The output ends with a newline — print one after the last line.
Hints2 available
Sign in to use hintsTopics:
StringsVariables
1
Tab to indent (Esc then Tab to move on) · Ctrl+Enter to run · Ctrl+Space to expand shortcuts (pr, inp, def)
Your Output
Run your code to see the output here...
Test Cases
Run your code to see test case results.