0

"\h\h" Why this returns '\\h\\h' inside python ?

15th Jan 2021, 2:33 PM
Gautam Yadav
Gautam Yadav - avatar
4 RĂ©ponses
+ 3
Do you mean? The "\\h\\h" is the input. And the "\h\h" is output. Then it is because backslash are used for escaping characters, so here the interpreter will recognize that "h" is being escaped by the backslash before it. And so If you want to print the backslash itself, then you also have to escape it (the backslash) Or you can just use the "r" prefix for strings r means raw or raw string For example: print( "\\n\\n" ) >> \n\n print( r"\n\n" ) >> \n\n
15th Jan 2021, 4:22 PM
noteve
noteve - avatar
15th Jan 2021, 4:50 PM
Gautam Yadav
Gautam Yadav - avatar
0
â™€â™ąâ˜ž 𝐊𝐱𝐱𝐛𝐹 𝐆𝐡𝐚đČđšđ„ â˜œâ™ąâ™€ well, it not happens with print. Never mind I searched and got my answer, anywas thanks for trying :)
15th Jan 2021, 3:52 PM
Gautam Yadav
Gautam Yadav - avatar