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