Python语法错误,代码正确 [英] Python Syntax Error with correct code
本文介绍了Python语法错误,代码正确的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
所以我做了一些代码,因为我是编程中的菜鸟,我正在做游戏结束程序。这是代码
>>>打印(游戏结束)
游戏结束
>>>
因为在我点击IDLE之前编辑然后我去运行,然后运行模块,它说无效语法。我做错了什么,对不起noob问题。
注意 - 我使用的是Python 3.4.3
So I have done some code as I am a noob in programming and I am doing the Game Over program.Here is the code
>>> print("game over")
game over
>>>
Because before the I clicked edit with IDLE and then I went to run,then run module and it says invalid syntax.What have I done wrong,sorry for the noob question.
Note-I'm using Python 3.4.3
推荐答案
无法提供解决方案,因为你没有提供所有细节。
如果Python说有语法错误,你可以非常自信你的代码不正确。
带有打印的3行肯定不是你试图运行的模块。
3行正在寻找更像是一个控制台命令。
为了给你一个真正的解决方案,你需要给我们更多细节和模块源代码。
对于模块代码,复制/粘贴代码,不要重新键入,精确的代码与Python有关。
我建议你阅读并按照教程。互联网上有很多问题,只有谷歌。
Impossible to give a Solution, because you did not give all details.
If Python says that there is a syntax error, you can be pretty confident that your code is not correct.
The 3 line with "print" is certainly not the module you try to run.
The 3 lines are looking more like a console command.
To give you a real solution, you need to give us more details and the module source code.
For the module code, Copy/Paste the code, don't retype it, exact code matters with Python.
I recommend you to read and follow tutorials. A lot of matter is available on internet, just Google.
转到 https ://docs.python.org/3.3/tutorial/index.html [ ^ ]并处理所有样本。它会变得清晰。
Go to https://docs.python.org/3.3/tutorial/index.html[^] and work through all the samples. It will become clear.
这篇关于Python语法错误,代码正确的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文