Yoromi 发表于 2021-2-1 10:58:18

刚入鱼C的坑,学习Python时出现这个问题是怎么回事啊?

>>> x, y = y, x
>>> print(x, y)
5 3
>>> print("Let's go!")
Let's go!
>>> print("Let's go!")
Let's go!
>>> print('\"Life is short,you need Python\",let\'s go')
"Life is short,you need Python",let's go
>>> print(Are you ok? \n Please come with me)
SyntaxError: invalid syntax
>>> print(Are you ok? \n Please comeon)
SyntaxError: invalid syntax

{:10_257:} {:10_282:}

51Arduino32 发表于 2021-2-1 11:09:55

语法错误
打印字符串需要加 一对单引号,或者双引号
print("Are you ok? \n Please comeon")

Yoromi 发表于 2021-2-1 11:19:14

51Arduino32 发表于 2021-2-1 11:09
语法错误
打印字符串需要加 一对单引号,或者双引号
print("Are you ok? \n Please comeon")

{:10_282:}谢谢!

51Arduino32 发表于 2021-2-1 11:27:24

Yoromi 发表于 2021-2-1 11:19
谢谢!

{:10_323:}
页: [1]
查看完整版本: 刚入鱼C的坑,学习Python时出现这个问题是怎么回事啊?