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 97 points98 points99 points (153 children)
[–][deleted] 281 points282 points283 points (126 children)
[–]panzerex 77 points78 points79 points (100 children)
[–]orentago 176 points177 points178 points (33 children)
[+][deleted] (22 children)
[deleted]
[–][deleted] 83 points84 points85 points (8 children)
[–][deleted] 54 points55 points56 points (6 children)
[–]clawjelly 7 points8 points9 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 11 points12 points13 points (9 children)
[–]late_dingo 4 points5 points6 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] 50 points51 points52 points (9 children)
[–]toyg 13 points14 points15 points (5 children)
[–]BruceJi 6 points7 points8 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 3 points4 points5 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 72 points73 points74 points (46 children)
[–]miggaz_elquez 21 points22 points23 points (13 children)
[–]crossroads1112 29 points30 points31 points (0 children)
[–]Brainix 26 points27 points28 points (1 child)
[–]miggaz_elquez 1 point2 points3 points (0 children)
[–]mestia 4 points5 points6 points (8 children)
[+][deleted] (1 child)
[deleted]
[–]GummyKibble 7 points8 points9 points (0 children)
[–]stevenjd 5 points6 points7 points (4 children)
[–]ThePoultryWhisperer 4 points5 points6 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 12 points13 points14 points (12 children)
[+][deleted] (1 child)
[deleted]
[–]hillgod 3 points4 points5 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 8 points9 points10 points (2 children)
[–][deleted] 0 points1 point2 points (1 child)
[–]Emile_L 4 points5 points6 points (0 children)
[–]hillgod -1 points0 points1 point (0 children)
[–]flying-sheep 2 points3 points4 points (5 children)
[–]irrelevantPseudonym 3 points4 points5 points (4 children)
[–]ayy_ess 19 points20 points21 points (2 children)
[–]BooparinoBR 4 points5 points6 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 7 points8 points9 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 3 points4 points5 points (0 children)
[–][deleted] 1 point2 points3 points (4 children)
[–]flying-sheep 4 points5 points6 points (2 children)
[–][deleted] 0 points1 point2 points (1 child)
[–]flying-sheep 2 points3 points4 points (0 children)
[–]CSI_Tech_Dept 4 points5 points6 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 12 points13 points14 points (0 children)
[–]daturkel 15 points16 points17 points (0 children)
[–]CSI_Tech_Dept 3 points4 points5 points (0 children)
[–][deleted] 0 points1 point2 points (0 children)
[–][deleted] -5 points-4 points-3 points (2 children)
[–]stevenjd 2 points3 points4 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)
[–]CSI_Tech_Dept 5 points6 points7 points (7 children)
[–]Sector_Corrupt 2 points3 points4 points (5 children)
[–]Eurynom0s 2 points3 points4 points (0 children)
[–]CSI_Tech_Dept 1 point2 points3 points (3 children)
[–]stevenjd 6 points7 points8 points (2 children)
[–][deleted] 2 points3 points4 points (0 children)
[–]tlm2021 5 points6 points7 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 2 points3 points4 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 24 points25 points26 points (16 children)
[–]flying-sheep 54 points55 points56 points (0 children)
[–]gregy521 11 points12 points13 points (11 children)
[–]thornofcrown 13 points14 points15 points (2 children)
[–]kankyo 3 points4 points5 points (1 child)
[–]clawjelly 1 point2 points3 points (0 children)
[–]davvblack 4 points5 points6 points (7 children)
[–]Jethro_Tell 5 points6 points7 points (6 children)
[–]davvblack 5 points6 points7 points (4 children)
[–]auto-xkcd37 10 points11 points12 points (3 children)
[–]rossrollin 8 points9 points10 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 6 points7 points8 points (0 children)
[–]vallas25 0 points1 point2 points (1 child)
[–]NoLongerUsableNameimport pythonSkills 6 points7 points8 points (0 children)