课程
/后端开发
/Python
/初识Python
z
\n 表示换行 \t 表示一个制表符 \\ 表示 \ 字符本身 \n表示换行理解了 剩下俩个还没理解 \\不是表示\本身吗,为啥显示请检查输出是否匹配,老师能列举下 \t 和\\的例子吗?
2020-01-06
源自:初识Python 3-5
正在回答
print("\\")
print("1\t2")
打印:
\ 1 2
https://www.runoob.com/python/python-strings.html
题目要求打印:
Python was started in 1989 by "Guido".Python is free and easy to learn.
Python was started in 1989 by "Guido".
Python is free and easy to learn.
所以1989前不应该有\\
另外,该字符串内仅含“”,无需转义。
因此,
s = 'Python was started in 1989 by "Guido".\nPython is free and easy to learn.'print s
即可。
举报
学python入门视频教程,让你快速入门并能编写简单的Python程序