学习笔记(04):Python 面试100讲(基于Python3.x)-你真的了解Python字符串吗

立即学习:https://edu.csdn.net/course/play/26755/340117?utm_source=blogtoedu

1.转义符:输出任何字符,包括同时输出单引号和双引号

print('"hello"\'world\'')

2.让转义符失效:(3种方法:r、repr和\)

print(r'let\'s go!)

3.保证原始格式输出:三个单引号

print('''

             hello

           '''

                )

发布了26 篇原创文章 · 获赞 2 · 访问量 294

猜你喜欢

转载自blog.csdn.net/qq_35504363/article/details/104206864