Python字符串前缀

字符串前缀

含义

  • u 表示 unicode,可存储中文。
  • b 表示 bytes,不能存储中文。
  • r 表示 raw,不识别转义字符。
  • f 表示 format,格式化。

使用

print(r"tes\nt")