1.作为转义字符对字符串种的引号进行转义:
‘let’\s go!’
“let’s go!”
此处中‘\’即为转义字符
2.换行
print ‘Once upon a time, there was a king’\
‘called Gumby.’
输出结果为:Once upon a time,there was a king name called Gumby.
3.用于不同的字母前表示不同的含义:
如 \n表示换行,\t表示制表,(遇到再及时的更新)
print(“He is a boy, \n but she is a girl”)
结果
He is a boy,
but she is a girl.