python | 变量与数据 | 字符串转义 | 输入多行

Posted yuzhen233

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了python | 变量与数据 | 字符串转义 | 输入多行相关的知识,希望对你有一定的参考价值。

 1 # encoding: utf-8
 2 
 3 # 字符串转义
 4 s = I\‘m ok
 5 print(s)
 6 s = Learn \"Python\" in imooc
 7 print(s)
 8 s = Bob said \"I\‘m ok\"
 9 print(s)
10 
11 # r 不进行转义
12 print(r"\ndfd\n\fdfd\n")
13 
14 # 输入多行
15 s = ‘‘‘Python is created by "Guido".
16 It is free and easy to learn.
17 Let‘s start learn Python in imooc!‘‘‘
18 print(s)

 

以上是关于python | 变量与数据 | 字符串转义 | 输入多行的主要内容,如果未能解决你的问题,请参考以下文章