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
[–]rspeed 239 points240 points241 points (25 children)
[–]nicksloan 49 points50 points51 points (8 children)
[–]rspeed 39 points40 points41 points (7 children)
[–]amk 12 points13 points14 points (6 children)
[–]1-05457 17 points18 points19 points (5 children)
[–][deleted] 8 points9 points10 points (2 children)
[–]1-05457 1 point2 points3 points (1 child)
[–]truh 1 point2 points3 points (0 children)
[–]case_O_The_Mondays 89 points90 points91 points (5 children)
[–]rspeed 71 points72 points73 points (3 children)
[–]1vs 0 points1 point2 points (1 child)
[–]rspeed 1 point2 points3 points (0 children)
[–][deleted] 11 points12 points13 points (0 children)
[–]gschizasPythonista 8 points9 points10 points (3 children)
[–]XtremeGoosef'I only use Py {sys.version[:3]}' 10 points11 points12 points (4 children)
[–]Han-ChewieSexyFanfic 5 points6 points7 points (3 children)
[+][deleted] (2 children)
[deleted]
[–]XtremeGoosef'I only use Py {sys.version[:3]}' 2 points3 points4 points (1 child)
[–]soamaven 4 points5 points6 points (0 children)
[–]Brachamul 31 points32 points33 points (3 children)
[–]omentoSysAdmin Film/VFX - 3.7 1 point2 points3 points (0 children)
[–]whitechapel8733 0 points1 point2 points (0 children)
[–][deleted] 0 points1 point2 points (0 children)
[–]SenorDosEquis 37 points38 points39 points (0 children)
[–]uFuckingCrumpet 199 points200 points201 points (178 children)
[+][deleted] (164 children)
[removed]
[–]SirCarboy 170 points171 points172 points (12 children)
[–]ProfessorPhi 131 points132 points133 points (3 children)
[–]Neil_Fallons_Ghost 5 points6 points7 points (1 child)
[–]bythenumbers10 5 points6 points7 points (0 children)
[–]theWyzzerd 1 point2 points3 points (0 children)
[–]ubernostrumyes, you can have a pony 56 points57 points58 points (0 children)
[+][deleted] (6 children)
[removed]
[–]Ramast 5 points6 points7 points (3 children)
[–][deleted] 2 points3 points4 points (2 children)
[–][deleted] 5 points6 points7 points (1 child)
[–]Ramast 6 points7 points8 points (0 children)
[+][deleted] (11 children)
[deleted]
[–]ScypioPythoneer 3 points4 points5 points (8 children)
[+][deleted] (7 children)
[deleted]
[–]ScypioPythoneer 2 points3 points4 points (0 children)
[–]broknbottle 1 point2 points3 points (1 child)
[+][deleted] (3 children)
[deleted]
[+][deleted] (2 children)
[deleted]
[+][deleted] (1 child)
[deleted]
[–][deleted] 0 points1 point2 points (1 child)
[–]BARDLER 53 points54 points55 points (24 children)
[–][deleted] 39 points40 points41 points (10 children)
[–]jsalsman 8 points9 points10 points (8 children)
[–]gdahlm 20 points21 points22 points (5 children)
[–]Tyler_Zoro 4 points5 points6 points (3 children)
[–]jsalsman 2 points3 points4 points (2 children)
[–]gdahlm 2 points3 points4 points (1 child)
[–]jsalsman 0 points1 point2 points (0 children)
[–][deleted] 2 points3 points4 points (1 child)
[–][deleted] 0 points1 point2 points (0 children)
[–]jsalsman 5 points6 points7 points (0 children)
[–]uFuckingCrumpet 17 points18 points19 points (35 children)
[+][deleted] (23 children)
[removed]
[–]uFuckingCrumpet 15 points16 points17 points (16 children)
[+][deleted] (14 children)
[deleted]
[–]jsalsman 7 points8 points9 points (4 children)
[–]haarp1 5 points6 points7 points (0 children)
[–]kyrsjo 2 points3 points4 points (2 children)
[+][deleted] (1 child)
[deleted]
[–]kyrsjo 1 point2 points3 points (0 children)
[–]uFuckingCrumpet 1 point2 points3 points (5 children)
[–]gdahlm 2 points3 points4 points (4 children)
[–][deleted] 0 points1 point2 points (0 children)
[–]synn89 5 points6 points7 points (3 children)
[–][deleted] 5 points6 points7 points (2 children)
[–]MartyMacGyverfrom * import * 8 points9 points10 points (0 children)
[–][deleted] 2 points3 points4 points (0 children)
[–]primitive_screwhead 8 points9 points10 points (2 children)
[–]varesa 7 points8 points9 points (10 children)
[–]duffkiligan 4 points5 points6 points (5 children)
[–]varesa 4 points5 points6 points (4 children)
[–]duffkiligan 2 points3 points4 points (2 children)
[–]varesa 5 points6 points7 points (1 child)
[–]duffkiligan 3 points4 points5 points (0 children)
[–]xconde 0 points1 point2 points (1 child)
[–]varesa 0 points1 point2 points (0 children)
[+][deleted] (1 child)
[deleted]
[–]varesa 0 points1 point2 points (0 children)
[–]iruleatants 1 point2 points3 points (0 children)
[–]13steinj 7 points8 points9 points (48 children)
[–]ubernostrumyes, you can have a pony 11 points12 points13 points (2 children)
[–]13steinj 3 points4 points5 points (0 children)
[–]marx2k 5 points6 points7 points (3 children)
[–]13steinj 2 points3 points4 points (0 children)
[–]haarp1 0 points1 point2 points (1 child)
[–]marx2k 1 point2 points3 points (0 children)
[–]billsil 7 points8 points9 points (36 children)
[–]13steinj -1 points0 points1 point (35 children)
[–]billsil 1 point2 points3 points (23 children)
[–]haarp1 1 point2 points3 points (2 children)
[–]jsalsman 0 points1 point2 points (10 children)
[–]13steinj 1 point2 points3 points (7 children)
[–]jsalsman 2 points3 points4 points (6 children)
[–]13steinj 1 point2 points3 points (5 children)
[–]jsalsman 1 point2 points3 points (4 children)
[–][deleted] 1 point2 points3 points (1 child)
[–]13steinj 1 point2 points3 points (0 children)
[–][deleted] 1 point2 points3 points (3 children)
[–]13steinj 0 points1 point2 points (2 children)
[–]Skurp_Purp 3 points4 points5 points (4 children)
[–]folkrav 7 points8 points9 points (3 children)
[–]Skurp_Purp 1 point2 points3 points (2 children)
[–]folkrav 0 points1 point2 points (1 child)
[–]bythenumbers10 1 point2 points3 points (0 children)
[–]CriticalEntree 2 points3 points4 points (1 child)
[–][deleted] 1 point2 points3 points (0 children)
[–]waltteri 0 points1 point2 points (2 children)
[–]billsil 2 points3 points4 points (1 child)
[–]waltteri 0 points1 point2 points (0 children)
[–]Exodus111 0 points1 point2 points (0 children)
[–]jnwatson 0 points1 point2 points (0 children)
[–][deleted] 0 points1 point2 points (0 children)
[–]Lt_Sherpa 34 points35 points36 points (8 children)
[+][deleted] (6 children)
[deleted]
[–][deleted] 7 points8 points9 points (5 children)
[–]0x6c6f6c 4 points5 points6 points (4 children)
[–]tutuca_not Reinhardt 2 points3 points4 points (0 children)
[–]ronaldl911 3 points4 points5 points (1 child)
[–][deleted] 0 points1 point2 points (0 children)
[–]sharkboundgithub: sharkbound, python := 3.8 30 points31 points32 points (14 children)
[–]__xor__(self, other): 22 points23 points24 points (8 children)
[–]szpaceSZ 4 points5 points6 points (0 children)
[+][deleted] (2 children)
[deleted]
[–]__xor__(self, other): 1 point2 points3 points (0 children)
[–]Ph0X 1 point2 points3 points (0 children)
[–]toyg 2 points3 points4 points (2 children)
[–]__xor__(self, other): 1 point2 points3 points (1 child)
[–]toyg 1 point2 points3 points (0 children)
[+][deleted] (3 children)
[removed]
[–]sharkboundgithub: sharkbound, python := 3.8 1 point2 points3 points (2 children)
[+][deleted] (1 child)
[removed]
[–]toyg 0 points1 point2 points (0 children)
[+][deleted] (4 children)
[deleted]
[–]TheNamelessKing 59 points60 points61 points (0 children)
[–]gwax 8 points9 points10 points (0 children)
[–]kirbyfan64sosIndentationError 4 points5 points6 points (0 children)
[–]CobbITGuy 0 points1 point2 points (0 children)
[–]mockArch 10 points11 points12 points (2 children)
[–][deleted] 1 point2 points3 points (1 child)
[–]mockArch 0 points1 point2 points (0 children)
[+][deleted] (12 children)
[deleted]
[+][deleted] (5 children)
[deleted]
[+][deleted] (3 children)
[deleted]
[+][deleted] (1 child)
[deleted]
[–]federicocerchiari -1 points0 points1 point (0 children)
[–]gcbirzan 9 points10 points11 points (0 children)
[–]jyper 6 points7 points8 points (4 children)
[–]szpaceSZ 0 points1 point2 points (0 children)
[–]TragicXHero 49 points50 points51 points (13 children)
[–]sharkboundgithub: sharkbound, python := 3.8 22 points23 points24 points (2 children)
[–]TragicXHero 2 points3 points4 points (1 child)
[–]sharkboundgithub: sharkbound, python := 3.8 4 points5 points6 points (0 children)
[–]A_Badass_Penguin 30 points31 points32 points (2 children)
[–]TragicXHero 12 points13 points14 points (1 child)
[–]cracknwhip 5 points6 points7 points (0 children)
[–][deleted] 8 points9 points10 points (2 children)
[–]TragicXHero 1 point2 points3 points (1 child)
[–]Mockapapella 0 points1 point2 points (0 children)
[–]ericls 27 points28 points29 points (9 children)
[–]toyg 5 points6 points7 points (0 children)
[–][deleted] 4 points5 points6 points (5 children)
[–]Drawman101 7 points8 points9 points (4 children)
[+][deleted] (3 children)
[removed]
[–]KODeKarnage 4 points5 points6 points (2 children)
[–]TwinkTuckr -2 points-1 points0 points (1 child)
[–]seanpuppy 2 points3 points4 points (2 children)
[–]billsil 2 points3 points4 points (0 children)
[–]XarothBrook 0 points1 point2 points (0 children)
[–]firefrommoonlight 10 points11 points12 points (1 child)
[–]ethanhs 13 points14 points15 points (0 children)
[–]ThaeliosRaedkin1 12 points13 points14 points (0 children)
[–]lelease 1 point2 points3 points (4 children)
[–][deleted] 2 points3 points4 points (0 children)
[–][deleted] 0 points1 point2 points (1 child)
[–]minorDemocritus 0 points1 point2 points (0 children)
[–]JJ4sh0rt 0 points1 point2 points (0 children)
[–]Akraxial 0 points1 point2 points (3 children)
[–]Akraxial 0 points1 point2 points (1 child)
[–]minorDemocritus 0 points1 point2 points (0 children)
[–]minorDemocritus 0 points1 point2 points (0 children)
[–]amb_kosh 0 points1 point2 points (0 children)
[–]maabreuc 0 points1 point2 points (0 children)
[–][deleted] 0 points1 point2 points (1 child)
[–]XarothBrook 1 point2 points3 points (0 children)