why is the answer \"? that's where I'm lost! thanks | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

why is the answer \"? that's where I'm lost! thanks

14th Jul 2016, 1:40 AM
Jamar Estwick
Jamar Estwick - avatar
3 Answers
+ 4
'\' is escape sequence. It would skip the value next to '\' for example: print('how're you?) will throw error, because python thinks the string ends with 'how' and it just omit, 're you?' because of single quote. we can use \ to tackle, this situation. print('how\'re you?') now python would see the escape sequence and eliminate the character from executing so that it will print the entire sentence with single quote Shortly '\' is escape sequence, which omits character next to it.
14th Jul 2016, 2:44 AM
sundar
sundar - avatar
0
I understand now. thank you so much
14th Jul 2016, 3:07 AM
Jamar Estwick
Jamar Estwick - avatar
0
:-) cheers
14th Jul 2016, 3:40 AM
sundar
sundar - avatar