將字符串轉(zhuǎn)換為raw以后,轉(zhuǎn)義字符串就無效了嗎?
print(r'''"To be, or not to be": that is the question.
Whether it's nobler in the mind to suffer.''')
換行的那個(gè)轉(zhuǎn)義字符\n,寫了之后也不換行,而是直接輸出\n了
print(r'''"To be, or not to be": that is the question.
Whether it's nobler in the mind to suffer.''')
換行的那個(gè)轉(zhuǎn)義字符\n,寫了之后也不換行,而是直接輸出\n了
2021-06-24
舉報(bào)
2021-06-25
是的,在字符串前面加轉(zhuǎn)義無效符r會(huì)使當(dāng)前字符串的轉(zhuǎn)義字符無效化