1. r 表示这是一个 raw 字符串,里面的字符就不需要转义了
print r'\(~_~)/ \(~_~)/'
r’…’表示法不能表示多行字符串,也不能表示包含’和 “的字符串
2. 用”’…”’表示多行字符串
print '''I love
you forever,
please believe me'''
3. 多行字符串也变成一个raw字符串
print r'''I love
you forever,"Joe"
please believe me'''
4. 请把下面的字符串用r”’…”’的形式改写,并用print打印出来:
‘\”To be, or not to be\”: that is the question.\nWhether it\’s nobler in the mind to suffer.’
print r'''"To be, or not to be": that is the question.
Whether it's nobler in the mind to suffer.'''