Escape Characters (Writing /n as Output) | Sololearn: Learn to code for FREE!
Новый курс! Каждый программист должен знать генеративный ИИ!
Попробуйте бесплатный урок
0

Escape Characters (Writing /n as Output)

So I was trying to get an output where I write: /n is an escape character, but then when I typed that in the code, the ouput would just give me a newline, how do I get an output of /n as a string output, I’m not trying to make a new line, I’m trying to type /n out... Thanks, sorry if it’s a little confusing.

23rd Sep 2018, 6:44 PM
Quan Huynh
Quan Huynh - avatar
4 ответов
+ 6
https://knowledge.kitchen/Raw_strings_in_Python
23rd Sep 2018, 7:21 PM
Mert Yazıcı
Mert Yazıcı - avatar
+ 5
you need to escape the character like so... ( "\\n"); this goes the same for quotation marks( "\"hey\"");
23rd Sep 2018, 6:48 PM
D_Stark
D_Stark - avatar
+ 5
use raw string
23rd Sep 2018, 6:56 PM
Mert Yazıcı
Mert Yazıcı - avatar
0
what's a raw string?
23rd Sep 2018, 7:16 PM
Quan Huynh
Quan Huynh - avatar