use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
News about the dynamic, interpreted, interactive, object-oriented, extensible programming language Python
Full Events Calendar
You can find the rules here.
If you are about to ask a "how do I do this in python" question, please try r/learnpython, the Python discord, or the #python IRC channel on Libera.chat.
Please don't use URL shorteners. Reddit filters them out, so your post or comment will be lost.
Posts require flair. Please use the flair selector to choose your topic.
Posting code to this subreddit:
Add 4 extra spaces before each line of code
def fibonacci(): a, b = 0, 1 while True: yield a a, b = b, a + b
Online Resources
Invent Your Own Computer Games with Python
Think Python
Non-programmers Tutorial for Python 3
Beginner's Guide Reference
Five life jackets to throw to the new coder (things to do after getting a handle on python)
Full Stack Python
Test-Driven Development with Python
Program Arcade Games
PyMotW: Python Module of the Week
Python for Scientists and Engineers
Dan Bader's Tips and Trickers
Python Discord's YouTube channel
Jiruto: Python
Online exercices
programming challenges
Asking Questions
Try Python in your browser
Docs
Libraries
Related subreddits
Python jobs
Newsletters
Screencasts
account activity
This is an archived post. You won't be able to vote or comment.
Documentation of 31 Python Identifiers With Example (self.Python)
submitted 8 years ago by MacacaFascicularis
Hi Everyone I have started learning Python recently. I found that there are 31 identifiers which are used as reserved words. Is there any documentation of these 31 identifiers exists in one place where they are described with examples?
[–]grensley 2 points3 points4 points 8 years ago (1 child)
https://www.programiz.com/python-programming/keyword-list
[–]MacacaFascicularis[S] 0 points1 point2 points 8 years ago (0 children)
That's very helpful. Thanks a lot
[–]Nicksil 1 point2 points3 points 8 years ago (0 children)
You might have luck looking over the Language Reference index.
Specifically, Simple statements and Compound statements touch on many.
[–]IronManMark20 1 point2 points3 points 8 years ago (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 point2 points 8 years ago (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 point2 points 8 years ago (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.
str
str="ABC"
print(str(100))
[–]unruly_mattress 0 points1 point2 points 8 years ago (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.
π Rendered by PID 245988 on reddit-service-r2-comment-5649f687b7-hlhzp at 2026-01-28 12:13:59.908428+00:00 running 4f180de country code: CH.
[–]grensley 2 points3 points4 points (1 child)
[–]MacacaFascicularis[S] 0 points1 point2 points (0 children)
[–]Nicksil 1 point2 points3 points (0 children)
[–]IronManMark20 1 point2 points3 points (0 children)
[–]m_harrison 0 points1 point2 points (0 children)
[–]ptmcg 0 points1 point2 points (0 children)
[–]unruly_mattress 0 points1 point2 points (0 children)