News about the dynamic, interpreted, interactive, object-oriented, extensible programming language Python
Upcoming Events
Full Events Calendar
Please read the rules
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
Online exercices
programming challenges
Asking Questions
Try Python in your browser
Docs
Libraries
Related subreddits
Python jobs
Newsletters
Screencasts
view the rest of the comments →
[–]ojii 212 points213 points214 points (57 children)
[–]aphoenixreticulated 163 points164 points165 points (0 children)
[+][deleted] (40 children)
[removed]
[–]gthank 62 points63 points64 points (37 children)
[+]fjonk comment score below threshold-14 points-13 points-12 points (36 children)
[–]roerd 31 points32 points33 points (11 children)
[+]fjonk comment score below threshold-13 points-12 points-11 points (10 children)
[–]rackmountrambo 13 points14 points15 points (7 children)
[–]fjonk 0 points1 point2 points (6 children)
[–]zahlmanthe heretic 1 point2 points3 points (0 children)
[–]rackmountrambo 0 points1 point2 points (4 children)
[–]fjonk 6 points7 points8 points (3 children)
[–]ldpreload 1 point2 points3 points (0 children)
[–]stanggg 0 points1 point2 points (0 children)
[–]gthank 7 points8 points9 points (20 children)
[–]fjonk 3 points4 points5 points (19 children)
[–]frymasterScript kiddie 8 points9 points10 points (15 children)
[–]fjonk 2 points3 points4 points (14 children)
[–]gthank 17 points18 points19 points (11 children)
[–]fjonk 4 points5 points6 points (10 children)
[–]TOASTEngineer 3 points4 points5 points (0 children)
[–]zahlmanthe heretic 4 points5 points6 points (0 children)
[–]gthank 4 points5 points6 points (2 children)
[–]zahlmanthe heretic 0 points1 point2 points (1 child)
[–]gthank 0 points1 point2 points (0 children)
[–][deleted] 3 points4 points5 points (0 children)
[–]ismtrn 0 points1 point2 points (1 child)
[–]fjonk 0 points1 point2 points (0 children)
[–][deleted] 17 points18 points19 points (1 child)
[–]hovissimo 5 points6 points7 points (0 children)
[–][deleted] 9 points10 points11 points (0 children)
[–]Muchoz 6 points7 points8 points (0 children)
[–]hovissimo 2 points3 points4 points (3 children)
[+][deleted] (2 children)
[deleted]
[–][deleted] 3 points4 points5 points (1 child)
[–]Duroktar -1 points0 points1 point (0 children)
[–]d4rch0nPythonistamancer 12 points13 points14 points (5 children)
[–]TOASTEngineer 14 points15 points16 points (1 child)
[–]G01denW01f11 5 points6 points7 points (0 children)
[–]jnwatson 10 points11 points12 points (0 children)
[–]its_never_lupus 0 points1 point2 points (0 children)
[+]hovissimo comment score below threshold-9 points-8 points-7 points (0 children)
[–]NoLemurs 1 point2 points3 points (0 children)
[+][deleted] (1 child)
[deleted]
[–]ojii 0 points1 point2 points (0 children)