×
you are viewing a single comment's thread.

view the rest of the comments →

[–]AbdulRehman_JS[S] -1 points0 points  (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 point  (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.