python转义字符失效的原因:
1、转义字符前加了字母“r”
r 可使字符串内(除字符串最后一位是 \ 的情况)所有的转义字符 \ 都失效。
>>>print("helloworld!") helloworld! >>>print("hello\nworld!") hello world! >>>print("hello"r"\nworld!") hello\nworld!
2、在转义字符前加“\”
© 版权声明
文章版权归作者所有,未经允许请勿转载。
THE END
python转义字符失效的原因:
1、转义字符前加了字母“r”
r 可使字符串内(除字符串最后一位是 \ 的情况)所有的转义字符 \ 都失效。
>>>print("helloworld!") helloworld! >>>print("hello\nworld!") hello world! >>>print("hello"r"\nworld!") hello\nworld!
2、在转义字符前加“\”
暂无评论内容