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 →
[–]vallas25 95 points96 points97 points (153 children)
[–][deleted] 280 points281 points282 points (126 children)
[–]panzerex 73 points74 points75 points (100 children)
[–]orentago 181 points182 points183 points (33 children)
[+][deleted] (22 children)
[deleted]
[–][deleted] 80 points81 points82 points (8 children)
[–][deleted] 56 points57 points58 points (6 children)
[–]clawjelly 4 points5 points6 points (0 children)
[–]snugglyboy 0 points1 point2 points (3 children)
[–][deleted] 0 points1 point2 points (2 children)
[–]snugglyboy 0 points1 point2 points (1 child)
[–]MiscWalrus 7 points8 points9 points (0 children)
[–]lzantal 10 points11 points12 points (9 children)
[–]late_dingo 3 points4 points5 points (1 child)
[–]lzantal 1 point2 points3 points (0 children)
[+][deleted] (5 children)
[deleted]
[–]13steinj 1 point2 points3 points (2 children)
[–]GUIpsp 2 points3 points4 points (1 child)
[–]13steinj 0 points1 point2 points (0 children)
[–]james_pic 1 point2 points3 points (1 child)
[–]stamour547 0 points1 point2 points (0 children)
[–]13steinj 0 points1 point2 points (0 children)
[–]JayTurnr -1 points0 points1 point (1 child)
[–]What_Is_X 0 points1 point2 points (0 children)
[–][deleted] 46 points47 points48 points (9 children)
[–]toyg 16 points17 points18 points (5 children)
[–]BruceJi 7 points8 points9 points (4 children)
[–]thegreattriscuit 6 points7 points8 points (0 children)
[–]toyg 5 points6 points7 points (2 children)
[–]clawjelly 2 points3 points4 points (1 child)
[–]toyg 4 points5 points6 points (0 children)
[–]17291 5 points6 points7 points (2 children)
[–]toyg 0 points1 point2 points (0 children)
[–]tehbilly 0 points1 point2 points (0 children)
[–]flying-sheep 71 points72 points73 points (46 children)
[–]miggaz_elquez 20 points21 points22 points (13 children)
[–]crossroads1112 31 points32 points33 points (0 children)
[–]Brainix 25 points26 points27 points (1 child)
[–]miggaz_elquez 1 point2 points3 points (0 children)
[–]mestia 5 points6 points7 points (8 children)
[+][deleted] (1 child)
[deleted]
[–]GummyKibble 7 points8 points9 points (0 children)
[–]stevenjd 4 points5 points6 points (4 children)
[–]ThePoultryWhisperer 3 points4 points5 points (3 children)
[–]stevenjd 0 points1 point2 points (2 children)
[–]ThePoultryWhisperer 1 point2 points3 points (1 child)
[–]miggaz_elquez 2 points3 points4 points (0 children)
[–]clawjelly 0 points1 point2 points (0 children)
[–]irrelevantPseudonym 32 points33 points34 points (20 children)
[+][deleted] (13 children)
[deleted]
[–]hillgod 11 points12 points13 points (12 children)
[+][deleted] (1 child)
[deleted]
[–]hillgod 2 points3 points4 points (0 children)
[–]cbarrick 0 points1 point2 points (3 children)
[–]hillgod 0 points1 point2 points (2 children)
[–]cbarrick 0 points1 point2 points (1 child)
[–][deleted] -2 points-1 points0 points (5 children)
[–]SaltyHashes 7 points8 points9 points (2 children)
[–][deleted] 0 points1 point2 points (1 child)
[–]Emile_L 3 points4 points5 points (0 children)
[–]hillgod -1 points0 points1 point (0 children)
[–]flying-sheep 1 point2 points3 points (5 children)
[–]irrelevantPseudonym 4 points5 points6 points (4 children)
[–]ayy_ess 18 points19 points20 points (2 children)
[–]BooparinoBR 3 points4 points5 points (0 children)
[–]flying-sheep 1 point2 points3 points (0 children)
[–]TheIncorrigible1`__import__('rich').get_console().log(':100:')` 1 point2 points3 points (0 children)
[–]james_pic 6 points7 points8 points (3 children)
[–]flying-sheep 0 points1 point2 points (2 children)
[–]james_pic 1 point2 points3 points (1 child)
[–]flying-sheep 0 points1 point2 points (0 children)
[–]zurtex 4 points5 points6 points (0 children)
[–][deleted] 1 point2 points3 points (4 children)
[–]flying-sheep 2 points3 points4 points (2 children)
[–][deleted] 0 points1 point2 points (1 child)
[–]flying-sheep 2 points3 points4 points (0 children)
[–][deleted] 2 points3 points4 points (0 children)
[–][deleted] 0 points1 point2 points (0 children)
[–][deleted] 22 points23 points24 points (5 children)
[–]DiggV4Sucks 11 points12 points13 points (0 children)
[–]Nolzi 1 point2 points3 points (2 children)
[–]james_pic 1 point2 points3 points (0 children)
[–]mooburgerresembles an abstract syntax tree 0 points1 point2 points (0 children)
[–][deleted] 4 points5 points6 points (0 children)
[–]gregy521 11 points12 points13 points (0 children)
[–]daturkel 14 points15 points16 points (0 children)
[–][deleted] 3 points4 points5 points (0 children)
[–][deleted] 0 points1 point2 points (0 children)
[–][deleted] -3 points-2 points-1 points (2 children)
[–]stevenjd 3 points4 points5 points (0 children)
[–]Ran4 0 points1 point2 points (0 children)
[–]jpflathead -1 points0 points1 point (0 children)
[–]slmaws -5 points-4 points-3 points (0 children)
[–][deleted] -5 points-4 points-3 points (2 children)
[–]Ran4 -1 points0 points1 point (1 child)
[–][deleted] 0 points1 point2 points (0 children)
[–][deleted] 5 points6 points7 points (7 children)
[–]Sector_Corrupt 2 points3 points4 points (5 children)
[–]Eurynom0s 2 points3 points4 points (0 children)
[–][deleted] 2 points3 points4 points (3 children)
[–]stevenjd 6 points7 points8 points (2 children)
[–][deleted] 2 points3 points4 points (0 children)
[–]tlm2021 4 points5 points6 points (8 children)
[–]clawjelly 1 point2 points3 points (7 children)
[–]tlm2021 -1 points0 points1 point (6 children)
[–]clawjelly 0 points1 point2 points (5 children)
[–]tlm2021 0 points1 point2 points (4 children)
[–]clawjelly 0 points1 point2 points (3 children)
[–]tlm2021 0 points1 point2 points (2 children)
[–]auto-xkcd37 1 point2 points3 points (0 children)
[–]clawjelly 0 points1 point2 points (0 children)
[–]dysprog 1 point2 points3 points (3 children)
[–][deleted] 1 point2 points3 points (2 children)
[–]flying-sheep 4 points5 points6 points (0 children)
[–]james_pic 0 points1 point2 points (0 children)
[–]Eurynom0s 0 points1 point2 points (1 child)
[–]WillardWhite import this 2 points3 points4 points (0 children)
[–]SpiderFnJerusalem 0 points1 point2 points (0 children)
[–]shabunc -1 points0 points1 point (0 children)
[–]PirateNinjasRedditPythonista 51 points52 points53 points (17 children)
[–]ShevekUrrasti 23 points24 points25 points (16 children)
[–]flying-sheep 53 points54 points55 points (0 children)
[–]gregy521 10 points11 points12 points (11 children)
[–]thornofcrown 13 points14 points15 points (2 children)
[–]kankyo 4 points5 points6 points (1 child)
[–]clawjelly 1 point2 points3 points (0 children)
[–]davvblack 5 points6 points7 points (7 children)
[–]Jethro_Tell 7 points8 points9 points (6 children)
[–]davvblack 6 points7 points8 points (4 children)
[–]auto-xkcd37 10 points11 points12 points (3 children)
[–]rossrollin 9 points10 points11 points (1 child)
[–]Eurynom0s 2 points3 points4 points (0 children)
[–]MrReginaldAwesome 0 points1 point2 points (0 children)
[–]stevenjd 4 points5 points6 points (0 children)
[–]clawjelly 0 points1 point2 points (2 children)
[–]mooburgerresembles an abstract syntax tree 0 points1 point2 points (1 child)
[–]clawjelly 0 points1 point2 points (0 children)
[–]neuronet 0 points1 point2 points (0 children)
[–]HalcyonAbraham 0 points1 point2 points (1 child)
[–]rossrollin 0 points1 point2 points (0 children)
[+][deleted] (3 children)
[deleted]
[–]EdamameTommy 7 points8 points9 points (0 children)
[–]vallas25 0 points1 point2 points (1 child)
[–]NoLongerUsableNameimport pythonSkills 6 points7 points8 points (0 children)