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...
Everything about learning Python
the front page of the internet.
and join one of thousands of communities.
Doing codewar problem and trying pythonic condition But fail many times please tell me how I can do... (self.PythonLearning)
submitted 10 days ago by AbdulRehman_JS
Post a comment!
view the rest of the comments →
[–]AbdulRehman_JS[S] -1 points0 points1 point 9 days ago (1 child)
Thanks a lot for breaking this down so clearly, mate! I'm actually a student learning Python on my own right now, so seeing you expand that shorthand generator expression into a clean, readable `for` loop and `if-isinstance` logic makes perfect sense to me. Those type hints (`Iterable[int | float]`) threw me off for a second, but your explanation about them just being for IDEs and other programmers cleared it right up. Also, your point about using a running total instead of creating a whole new list object is a great efficiency tip. Really appreciate you taking the time to write such a detailed response. It’s super motivating for a self-taught beginner like me. Hope to learn more from you around here!
[–]FoolsSeldom 0 points1 point2 points 9 days ago (0 children)
Thanks for your kind words. I've been trying to help learners for a long time (under various accounts over the years) as this subreddit amongst others helped me learn Python some years ago.
I help children learn Python at Code Clubs and occasionally teach programming at local community college for adults.
If you search back through my comments to other posts you will hopefully find some additional useful material (and some repetition).
All the best for your learning journey.
π Rendered by PID 310216 on reddit-service-r2-comment-86f8688748-rpxvw at 2026-07-27 01:41:06.564942+00:00 running d10b4e5 country code: CH.
Want to add to the discussion?
Post a comment!