what does backward-slash b do in Python?

前端 未结 2 2069
逝去的感伤
逝去的感伤 2020-12-07 00:45

what is the purpose of backward-slash b in python, I ran print \"\\\"foo\\bar\" in the python interpreter and got this result:

>>>p         


        
2条回答
  •  天涯浪人
    2020-12-07 01:16

    See the string literal documentation:

    \b ASCII Backspace (BS)

    It produces a backspace character. Your terminal backspaced over the second o when printing that character.

提交回复
热议问题