Why in the 2nd part there are double backslash | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Why in the 2nd part there are double backslash

Enter something please: This is what\nthe user enters! 'This is what\\nthe user enters!'

22nd Dec 2019, 3:41 AM
Sonu
Sonu - avatar
1 Answer
+ 2
People generally do it to print "\n" to the screen. "\\" is an escape sequence that returns a single backslash.
22nd Dec 2019, 4:11 AM
Avinesh
Avinesh - avatar