Home
Categories
WIKI
Topic
User
LANGUAGE:
中文
English
deepin15.11 运行python代码时报错
Experiences and Insight
671
views ·
7
replies ·
To
floor
Go
themask9527
deepin
2020-06-28 03:26
Author
语言 python3.7.7 软件VSCODE
运行下列代码时 总会提示 bash: 未预期的符号 `(' 附近有语法错误 而在WINdows下的VSCODE里运行则一切正常
age =
18
if
age >=
18
:
print
(
'你可以进网吧了'
)
Reply
Like 0
Favorite
View the author
All Replies
叶落随风
deepin
2020-06-28 04:37
#1
In [1]: age = 18
...: if age >= 18:
...: print('你可以进网吧了')
...:
你可以进网吧了
运行正常
Reply
Like 0
View the author
龙城大李
deepin
2020-06-28 04:46
#2
哈哈哈,你也遇到了。我之前给学生讲的时候也出现了这样的问题。
Reply
Like 0
View the author
SamLukeYes
deepin
2020-06-28 04:51
#3
要在脚本文件开头声明一下解释器,比如:
#!/usr/bin/python3
Copy the Code
Reply
Like 0
View the author
themask9527
deepin
2020-07-23 00:59
#4
声明了解释器了 没用哈
Reply
Like 0
View the author
Hello
deepin
2020-07-23 01:03
#5
print和(中间有个空格
Reply
Like 0
View the author
Hello
deepin
2020-07-23 01:05
#6
错了,你小子缩进忘了
Reply
Like 0
View the author
Hello
deepin
2020-07-23 01:05
#7
诶,不对,你有缩进
Reply
Like 0
View the author
Please
sign
in first
Featured Collection
Change
[Tutorial] deepin25 WSL Offline Installation Guide
UOS AI 2.8 Released! Three New Intelligent Agents & Major Evolution
Solid Q&A | deepin 25 Common Questions – The Immutable System Edition
New Thread
Popular Events
More
运行下列代码时 总会提示 bash: 未预期的符号 `(' 附近有语法错误 而在WINdows下的VSCODE里运行则一切正常
age = 18
if age >= 18:
print('你可以进网吧了')