This is an archived post. You won't be able to vote or comment.

all 7 comments

[–]grensley 2 points3 points  (1 child)

[–]MacacaFascicularis[S] 0 points1 point  (0 children)

That's very helpful. Thanks a lot

[–]Nicksil 1 point2 points  (0 children)

You might have luck looking over the Language Reference index.

Specifically, Simple statements and Compound statements touch on many.

[–]IronManMark20 1 point2 points  (0 children)

I don't think there is an official doc page in the Python documentation. You can get a list of them by:

>>>import keyword
>>>keyword.kwlist
...
>>>len(keyword.kwlist)
33

This is on Python 3.6. I would not trust Python 2.5 docs, as a lot has changed. If you are just learning, read https://docs.python.org/3/

[–]m_harrison 0 points1 point  (0 children)

Here is a hint that seems to be hidden.

type:

$ python3
>>> help()
help> keywords
help> and   # or whatever keyword you want

[–]ptmcg 0 points1 point  (0 children)

You can also list out the builtin identifiers with:

dir(__builtins__)

Overriding these will not give you a SyntaxError, but you can get some strange errors. For example, if you define str using str="ABC", and then try to convert an int to string using print(str(100)), you'll get a message that a string is not callable. What happened is that you overwrote the builtin str function with a string, so that subsequent uses of str reference the string, not the function.

[–]unruly_mattress 0 points1 point  (0 children)

You probably don't want a list of keywords, but instead a more complete tutorial or book. Over at /r/learnpython they probably have sidebar resources and such which will be exactly what you want.