+ 1
use of \n
I entered "Hello\nWorld" to go to a new line using IDLE Python 3.5.2 Shell. All I got after pressing enter was 'Hello\nWorld'. What did I do wrong?
3 Respuestas
+ 3
Oh basicly when program see this go to the next line... simple as that
0
the compiler is reading it as a whole string. if you're trying to use an end line try splitting it up your output. so output "Hello" '\n' "World". I'm not super-familiar with python, but usually '\n' is treated as a single character, not a string (like when you say "\n", the computer outputs exactly what you say within the quotation marks).
0
try. ("Hello \n world")