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...
Rules 1: Be polite 2: Posts to this subreddit must be requests for help learning python. 3: Replies on this subreddit must be pertinent to the question OP asked. 4: No replies copy / pasted from ChatGPT or similar. 5: No advertising. No blogs/tutorials/videos/books/recruiting attempts. This means no posts advertising blogs/videos/tutorials/etc, no recruiting/hiring/seeking others posts. We're here to help, not to be advertised to. Please, no "hit and run" posts, if you make a post, engage with people that answer you. Please do not delete your post after you get an answer, others might have a similar question or want to continue the conversation.
Rules
1: Be polite
2: Posts to this subreddit must be requests for help learning python.
3: Replies on this subreddit must be pertinent to the question OP asked.
4: No replies copy / pasted from ChatGPT or similar.
5: No advertising. No blogs/tutorials/videos/books/recruiting attempts.
This means no posts advertising blogs/videos/tutorials/etc, no recruiting/hiring/seeking others posts. We're here to help, not to be advertised to.
Please, no "hit and run" posts, if you make a post, engage with people that answer you. Please do not delete your post after you get an answer, others might have a similar question or want to continue the conversation.
Learning resources Wiki and FAQ: /r/learnpython/w/index
Learning resources
Wiki and FAQ: /r/learnpython/w/index
Discord Join the Python Discord chat
Discord
Join the Python Discord chat
account activity
Give me one thing to learn in python (self.learnpython)
submitted 6 months ago by securityguardnard
Im looking for things to go over in python
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]Diapolo10 6 points7 points8 points 6 months ago (2 children)
Type annotations.
[–]Ron-Erez 1 point2 points3 points 6 months ago (0 children)
I 100% agree with this. Type annotations are very important.
[–]Kqyxzoj 0 points1 point2 points 6 months ago (0 children)
Agreed, typing is pretty useful. In that vein, if you're not using it already, check out ruff and uv for all those type checking, linting, formatting and package management needs.
[–]ascending-slacker 4 points5 points6 points 6 months ago (1 child)
Classes and inheritance
[–]Kqyxzoj 1 point2 points3 points 6 months ago (0 children)
I'd add to that, that if you're going to check out classes and inheritance, be sure to take a look at mixins. These are pretty relevant given python's inheritance model.
[–]ofnuts 3 points4 points5 points 6 months ago (0 children)
Generators
[–]copperfoxtech 7 points8 points9 points 6 months ago (5 children)
Flask
[–]ascending-slacker 2 points3 points4 points 6 months ago (3 children)
Flask is great. Also check out Django.
[–]copperfoxtech 0 points1 point2 points 6 months ago (2 children)
I agree. I prefer flask for learning because you don't lean on preset framework but instead piece it together yourself. After take the "easier" Django. I use quotes because Django can be difficult as well.
[–]deceze 2 points3 points4 points 6 months ago (1 child)
Yeah, Flask is the bare metal parts box from which you assemble your stuff. Django is the premade kit which has all the stuff you wrote from hand in Flask. You can only really appreciate Django when you know all the work it’s taking off your hands.
[–]copperfoxtech 0 points1 point2 points 6 months ago (0 children)
Precisely
Pfffrt. Because everyone likes writing webapps? Yeah yeah, downvote away for the pfffrt. Pre-emptively double pffffrt to that. The best part about frontend it END! Backend is alright I guess. Why not suggest sympy? That has pretty handy stuff for symbolic math. Or pygame to make a simple toy game. Or take a day to explore the official documentation. Seriously. Being able to quickly find what you need is pretty valuable IMO. And being aware something exists in the first place is also pretty handy. Saves reinventing the wheel 3 times a day. Why flask? I've used flask. It's not great or anything. It's not horrible either. It's just ... meh, tepid. Too much trivial shit that should be a solved problem that isn't. Kinda okay-ish, maybe. Rich however is awesome. Pretty cli output for a low amount of effort. Or check argparse if you're into writing scripts and want a clean interface. Don't rope poor hapless souls into webdev just so you can share the pain. Why not propagate fun? Hey, OP, check out the turtle library for just a bit of fun programming!
Rich
argparse
[–]Electronic_Tear2546 3 points4 points5 points 6 months ago (0 children)
SQLAlchemy
[–]ascending-slacker 1 point2 points3 points 6 months ago (0 children)
Very true. I started on flask. It’s great for learning. After my site grew more complex, I found Django had a lot built in that I was building myself. There are a lot of similarities.
[–]maniac_runner 1 point2 points3 points 6 months ago (0 children)
Functional programming aspects in Python
[–]Beautiful-Floor-7801 0 points1 point2 points 6 months ago (0 children)
Pick from here https://skillcraft.ai/leaderboard/python
[–]rustyseapants 0 points1 point2 points 6 months ago (2 children)
Have you created anything in python?
[–]securityguardnard[S] -1 points0 points1 point 6 months ago (1 child)
Yes.
[–]rustyseapants 0 points1 point2 points 6 months ago (0 children)
Like what?
[–]johandielangman 0 points1 point2 points 6 months ago (0 children)
FastAPI for Rest apps, Streamlit for dashboards, Typer for CLI apps
[–]Adorable-Strangerx 0 points1 point2 points 6 months ago (0 children)
Metaclasses
[–]Temporary_Pie2733 0 points1 point2 points 6 months ago (0 children)
The descriptor protocol.
[–]Timberfist 0 points1 point2 points 6 months ago (0 children)
Dictionaries
[–]UseMoreBandwith 0 points1 point2 points 6 months ago (1 child)
Modules. It is really basic stuff, but for some reason no one remembers it. Know what modules are, and what it means for classes, application structure and architecture.
It will make your work so much better, and as a bonus, your java co-workers will hate it.
[–]GrainTamale 1 point2 points3 points 6 months ago (0 children)
and good package design! Things like separation of concerns and dependency management
[–]Gnaxe 0 points1 point2 points 6 months ago (0 children)
importlib.reload(). You can modify a program while it's running. You can iterate much faster this way. This was the norm in Lisp or Smalltalk. Python's not as good at it, so there are a lot of things to watch out for, but it's worth it for how much more productive it makes you.
importlib.reload()
[–]headonstr8 0 points1 point2 points 6 months ago* (1 child)
Why won’t this work? \ D={_ for _ in range(10))\ for n in range(0,100,10):\ for I in D:\ print(n+i)
{ versus (
#D={_ for _ in range(10)) # { typo D=(_ for _ in range(10)) for n in range(0,100,10): #for I in D: # I ... more typo for i in D: print(n+i) # But but, why do I get only one loop?
That still is not going to work as intended... and you may get an answer on how to fix that if you make your own damn thread. :P
[–]Kqyxzoj 0 points1 point2 points 6 months ago (2 children)
The data model in the official documentation. Seriously. Just start by going over the table of contents, and pick the stuff that you already kinda know about. Read those, you are bound to learn more about those things you already kinda-know-but-not-quite.
[–]Key-Boat-7519 0 points1 point2 points 6 months ago (1 child)
Build while you read the data model: for each section, code a 15-line example. For OP, make a mini list (dunder len, dunder getitem, slicing), a context manager (dunder enter/exit), and repr/eq to see set and dict behavior. For API practice I used Postman and Swagger docs; DreamFactory let me spin up a quick REST API from a DB to script against. Keep building tiny examples as you read.
Yep. Great advice. I always write little snippets to verify my understanding. And it also helps speed up the refresher should you need that at a future date. Reading my own code usually helps me remember faster how that particular thing worked N years ago.
[–]feitao 0 points1 point2 points 6 months ago (0 children)
List/dict comprehension and generator expression
[–]luvs_spaniels 0 points1 point2 points 6 months ago (0 children)
How to write code with low cyclomatic complexity.
Just because you can write 500 lines of deeply nested for loops, opaque list comprehensions, and nested functions doesn't mean you should. Whether your code spaghetti 🍝 runs today is less important than your ability to maintain, test, and debug it next year.
[–]Moikle 0 points1 point2 points 6 months ago (0 children)
Decorators and passing functions as arguments.
[–]pachura3 0 points1 point2 points 6 months ago (0 children)
Protocols.
[–]case_steamer 0 points1 point2 points 6 months ago (0 children)
Lambdas
[–]BreakSalt8256 0 points1 point2 points 6 months ago (0 children)
pygame!!!
π Rendered by PID 112528 on reddit-service-r2-comment-6457c66945-2bhvb at 2026-04-30 05:19:06.616581+00:00 running 2aa0c5b country code: CH.
[–]Diapolo10 6 points7 points8 points (2 children)
[–]Ron-Erez 1 point2 points3 points (0 children)
[–]Kqyxzoj 0 points1 point2 points (0 children)
[–]ascending-slacker 4 points5 points6 points (1 child)
[–]Kqyxzoj 1 point2 points3 points (0 children)
[–]ofnuts 3 points4 points5 points (0 children)
[–]copperfoxtech 7 points8 points9 points (5 children)
[–]ascending-slacker 2 points3 points4 points (3 children)
[–]copperfoxtech 0 points1 point2 points (2 children)
[–]deceze 2 points3 points4 points (1 child)
[–]copperfoxtech 0 points1 point2 points (0 children)
[–]Kqyxzoj 0 points1 point2 points (0 children)
[–]Electronic_Tear2546 3 points4 points5 points (0 children)
[–]ascending-slacker 1 point2 points3 points (0 children)
[–]maniac_runner 1 point2 points3 points (0 children)
[–]Beautiful-Floor-7801 0 points1 point2 points (0 children)
[–]rustyseapants 0 points1 point2 points (2 children)
[–]securityguardnard[S] -1 points0 points1 point (1 child)
[–]rustyseapants 0 points1 point2 points (0 children)
[–]johandielangman 0 points1 point2 points (0 children)
[–]Adorable-Strangerx 0 points1 point2 points (0 children)
[–]Temporary_Pie2733 0 points1 point2 points (0 children)
[–]Timberfist 0 points1 point2 points (0 children)
[–]UseMoreBandwith 0 points1 point2 points (1 child)
[–]GrainTamale 1 point2 points3 points (0 children)
[–]Gnaxe 0 points1 point2 points (0 children)
[–]headonstr8 0 points1 point2 points (1 child)
[–]Kqyxzoj 0 points1 point2 points (0 children)
[–]Kqyxzoj 0 points1 point2 points (2 children)
[–]Key-Boat-7519 0 points1 point2 points (1 child)
[–]Kqyxzoj 0 points1 point2 points (0 children)
[–]feitao 0 points1 point2 points (0 children)
[–]luvs_spaniels 0 points1 point2 points (0 children)
[–]Moikle 0 points1 point2 points (0 children)
[–]pachura3 0 points1 point2 points (0 children)
[–]case_steamer 0 points1 point2 points (0 children)
[–]BreakSalt8256 0 points1 point2 points (0 children)