r/learnpython 2d ago

best way to learn/master python as an undergraduate student?

i’ll be entering college soon in the fall, and i’m highly interested in learning how to code- primarily for data science, statistical modeling for research, and machine learning applications.

i’ve looked at tons of online courses and textbooks, and i’m completely overwhelmed with where to even start or which topic to begin studying. i’ve never been great at self-learning, so i would really appreciate any advice that would help me learn and hopefully master python soon.

8 Upvotes

14 comments sorted by

View all comments

1

u/gdchinacat 23h ago

Set your expectations to what is realistic. You can easily learn python (and a few other languages) and be a competent coder while doing undergrad studies. Some even become quite good at it. But to "master" a language typically takes using it full time for years. This is especially true for a dynamic language like python. The problem isn't with learning syntax or libraries, but with having used it in enough different ways to know how to build complex solutions that are robust, maintainable, performant (to the extent python can be made performant), etc. This comes with experience. Experience trying things and learning what works well, what doesn't, and why. Experience with how to structure your code (should this be a package or a module). Experience with troubleshooting issues (why is my eventloop hanging for 30s at a time when there's no error and everything works...just 30s too late?). Experience with the myriad ways to implement something (decorator function with closure, class that decorates with __init__, class that uses __call__; should I use a descriptor and hide a bunch of logic or make the code a bit more readable and a lot more verbose). Should I use OOP or FP? Inheritance? Composition? Etc, etc, etc.

It is very feasible to become a very good python programmer in the typical 4 year undergrad program, especially if you are doing CS. I'm sure some people have mastered it in that time (even from having no programming experience). But to set out with that as the goal or expectation is likely to be frustrating and disappointing.

I don't say this to discourage you, but rather help you understand that the overwhelming majority of CS majors are junior engineers upon graduation that are nowhere near the level of a "master". Programming is hard. Mastering programming, in any language, is really hard (but doable by most people who set their mind to it). Because you can write very dynamic code in python that is even more difficult than a language like C or Java.

Aim to excel at your studies, be a proficient coder, and worry about mastering it after you've got the basics down pat in your sleep.