Why in the 2nd part there are double backslash | Sololearn: Learn to code for FREE!
Neuer Kurs! Jeder Programmierer sollte generative KI lernen!
Kostenlose Lektion ausprobieren
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 Antwort
+ 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