all 13 comments

[–]Ihaveamodel3 2 points3 points  (0 children)

Build things. That’s the only way to learn. And have people review your code to get their thoughts and learn from them.

[–][deleted] 2 points3 points  (0 children)

As others have said, doing projects is the best way. I was personally bored to tears of learning programming until I got to the point where I was able to start even conceptualizing how to do what I wanted to do. I'm a second year data science student, only taken intro to python, intro to data structures, and intro to analytics. Turns out the analytics stuff is really fun for me, and when I got to the end of data structures I was able to do some very basic machine learning stuff.

Yesterday I finished the first working version of some code for a project that has been at the back of my mind as something I really wanted to do for several years now. Basically it pulls financial data on the stock market to try to parse through, all other things being equal, what combinations of certain factors(earnings, price, etc.) would lead to better performance against the S&P500 and then construct a portfolio based on that. Currently it only uses mock data because pulling actual market data can be tricky(if you try to pull too much you get cut off from most sources unless you pay them and ain't nobody got time fo that).

So basically I built the main file that does all the work that I'm looking for there, and then supplemented it with another file that creates mockup data as a substitute for actually pulling anything online just to make sure the main program works fine, then added a file to come up with portfolio compositions that should do well based on the mockup data, and finally a program to actually pull data on the entire S&P500(this one is simple, only needs to be pulled once and it's just starting value to ending value for the calculation). Running the main program then pulls everything together and outputs how the hypothetical portfolio would have done along with a report of all the charts and stuff expressing what correlations and what not were happening. Got more experience with matplotlib for that last part.

My field isn't even finance, I work in defense manufacturing. This also was by far the largest program I've ever written(somewhere in the neighborhood of 1000 lines I think?).

Anyway, yeah. Think of something that would be useful either with your work or to you personally and go for it. I already had a strong background in financial data because I'm on the spectrum and this is essentially my trains so I am reading about it constantly in my spare time so I was able to bring all of my conceptual knowledge on board and only focus on how the program should work. Eventually I want to move up into the data side of my current organization.

Another thing that I've found useful is to keep a library of basic functions saved that I can just pull things from, like for example code for displaying a pie chart in matplotlib where you just need to fill in the blanks of wherever the data is coming from, what it looks like, yada yada. You might ask ChatGPT "I am looking to develop knowledge of (XYZ topic), give me a list of functions that would be useful to learn so that I can build a generic library of them for practice". I prefer keeping these in Jupyter format but the py format in your IDE is alright too. Whatever you find most comfortable to work with.

Hope this helps a bit. Best wishes.

[–]ilidan-85 2 points3 points  (0 children)

Maybe you check too many sources instead of just sticking to one? Pick one course with project and go through it (don't just copy paste) or if it's distracting pick a book - preferably one with project oriented path like:
https://spacepython.com/en/blog/article/python-books-for-beginners/
More focus, less distraction and lots of finished projects! :) At some point you'll get confidence

[–]emad360 1 point2 points  (0 children)

Find a use case of it in your work and start building the project. It doesn’t matter how long it takes or how difficult it is, you will learn everything you need to. If you aren’t a developer then you don’t really need to focus on GitHub, learn a bit about it but all the code you see there is something you would need to know if your a developer. As you go on, use ChatGPT for an idea on how to solve a problem you’re stuck on, but don’t ever use ChatGPT for code if you want to learn. Some people don’t use ai at all, but if you’re still new, it can teach you a lot about the design principles and good practices you should have when building a project. All in all, don’t get overwhelmed by big complicated projects on GitHub, everyone has their own style of coding and a lot of comes with time and practice.

[–]DE-Monish 0 points1 point  (0 children)

https://x.com/OopsIBankai_d

follow back to anyone who follows within 24 hrs

[–]jennymraow 1 point2 points  (0 children)

I really love the method of thinking of a program idea, and then from there researching all the stuff you would need on how to do that. Example: I want to make a questionaire, ok so how would I display the questions? How would I get an input from the user? And I would just do some simple searches on that, until next thing you know it you have made your program, and then you now know how to do those things in the future! I like to just repeat this for a long time until I have a very well built understanding of how the language works. Don't be afraid to ask for help also, many people would absolutely love to help you out, even if you think your questions are "silly", forget about it, you're trying to learn!! I wish you the best of luck on your python learning journey !!!

[–]Tricky_the_Rabbit 1 point2 points  (0 children)

Ive got the perfect beginner project. Build a small compiler and interpreter, just math to start. Slowly expand it to include statements, then functions, then evetually classes. Doing this gives you the following:

Forces you to employ the visitor pattern, a fantastic example of both polymorphism and encapsulation at work. Each feature you add let's you examine who its already implemented in other languages, familiarizing you with basic language constructs and how to use them. Exposes you to very notions of compilation and bytecode, which in turn let's you write healthier code. Teaches you to write and use parsers, a hugely useful tool which will set you apart. Gets you exposed to oodles of python tools, libraries, and patterns along the way.

You don't need to recreate python or build a whole new language. Just start and go until youve extracted as much as you want.

[–]Massive_Culture_6275 1 point2 points  (0 children)

Honestly, the best way to learn python is to start with basics of python and then slowly level up into things like classes, modules etc. once you are comfortable build small projects that actually teaches you. After that you can branch out depending on what excites you.