selfteaching / selfteaching/selfteaching-python-camp
Day02 运行helloworld程序提示SyntaxError: invalid syntax
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 151
- Forks
- 875
- PR merge metrics
- No merged PRs in 30d
Description
在运行Python hello world程序中,终端提示 SyntaxError: invalid syntax 语法错误。
我又Google了这个问题的解法,发现的答案别人给出的答案就是这么写,我不信这个邪,一个字母一个字母确认有没有拼写错误,是不是没有缩进,是不是要在后面加冒号,我还想到了难道字符串要转换格式?我又把helloworld转换了字符串格式,但print后面还是不知道要加(),所以没有成功,功夫不负有心人,终于发现问题原来是我print后少一(),
Python 的3版本和2版本在 print 的语法上有一些区别,Python3 函数要加(),
还有一些常见的错误比如缩进 大小写区分也经常容易出错,
只要把报错信息复制Google一下,很容易就能找到答案。
希望不要再有人像我一个语法错误竟然debug 差不多花了差不多一个钟。
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
No file, test, or documentation entry point is named. Read the issue as a report of a Python 2/3 print-syntax learning problem; before starting, confirm that maintainers want this lesson captured or clarified in the project documentation. Done would mean the relevant beginner guidance reflects the reported distinction.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- documentation
- Issue type
- Documentation
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 20/100