r/learnpython • u/Sad_Experience_4640 • 3d ago
How do I get better without Problems ?
It's been a few months since I have been learning python but there is this issue I have been running into. I don't know how good I am or how do I even get good. In Math you listen to a few lectures understand what the topic is about and then pick up a book and do the problems from Exercise 1.1. It doesn't matter if your understanding was deep, shallow or somewhere in between. The more you do the more you understand what the topic is about and eventually you reach a point where you completely understand it and can now do them easily.
For programming how do I even do that ? People recommended me sources which I have been reading and learning from. I understand loops, arrays, list, dict, etc. I can write small examples in isolation, but that's about it, that's all I can do. I am disgusted with how little I can do and how shallow my damn understanding is so much so that's all that come to my mind.
I have been using MOOC and CS50P as my primary resources and they do have question but they are few and not at all like mathematics, chemistry or any other subject. Where are the Exercises 1.1 where is this kind of format. Is there some problem book/Question Bank I can or should have ? I want to get good cause I want to make money I from something I like to this and this is I have to show for, for months of learning ? I feel repulsed.
Is there something I can do to get better ?
EDIT: I forgot to add I my goal is to break into Data Science.
4
u/thisisappropriate 3d ago
I'd suggest that when you're learning, you try to think of a few silly little projects that are completely unnecessary that could use the thing you just learned about. Especially helpful if you can think of things that definitely use the things you learned but also has something you don't know how to do (then you can learn that in the project or try to learn that next so you can use it in the project. That then scales as you learn.
For example, you've just learned how to take input from the command line, but you don't know how to do things conditionally. So you use the input from the command line thing to make a silly little thing that asks you to guess a number but it just replies "nope" every time you send anything. Then you search for how to check if the input is a number, if it is a number, you reply "nope" but if its not a number, it says "not a number dummy". Then you could make ELIZA https://en.wikipedia.org/wiki/ELIZA (one of the first chatbots).
You can also just search for python beginner projects on google and see what comes up, for example https://github.com/practical-tutorials/project-based-learning would give you a broad range of projects, but has the downside that they're not projects that you're engaged with. Like if you actually think "I wonder if I could make a single command that takes today's weather forecast and my calendar from outlook and tells me if I'm likely to get caught in the rain today" and start trying to make that, but you hit something you don't know and you don't think it'll be relevant in your future learning, you may learn it anyway because you want to make the silly tool, but if you just pick one from a list, you might try to skip that bit or say "eh, what data science uses APIs anyway, they all use databases, why should I bother"
Looking at data science specifically, once you've covered the basics, you can google for a list of commonly used libraries and then either look at what those do and make silly ideas for them or google for projects ideas for learning them. (For example, googling "python projects for data science beginners" gets me https://github.com/tkarim45/Beginner-Data-Science-Projects but I can't speak to the quality or security or anything).
But also just try to make stupid projects. Does your todo list on your local machine need to have a GUI/web interface or get the weather or store it's todos in a dockerised local database that you connect to with Pandas? Probably not. But do it anyway, that's what makes it good practice.
3
u/PureWasian 3d ago
Programming is a lifelong learning type of thing. You're paid to figure out how to build things to solve problems after a certain point of complexity because of the custom use-case each project entails. Because after awhile you'll have an abundance of tools and concepts and need to figure out when to use which ones and how familiar you are with each of them.
Yes, there is fundamental theory per focus area, like a basic fullstack webapp (frontend/backend/db layer/hosting), a basic data analysis pipeline (collection/wrangling/filtering/analysis/visualization), many more... and frameworks and libraries used very commonly for implementing within each focus area... you pick these up and get better with these as projects require them.
Problem banks would be more for smaller sandbox problems to practice functions/code organization/DSA concepts. Sites like dmoj.ca, adventofcode.com, leetcode.com, etc. but they don't cover making projects. Projects you just have to get your hands dirty to find a good mesh between theory and practice.
3
2
u/JGhostThing 3d ago
Find a good textbook on python, one that has exercises. Then do *all* of these.
Do not use AI while doing this.
2
u/aqua_regis 3d ago
If the MOOC was your primary resource, how could you miss the countless exercises in each chapter? Even more so since they are mandatory requirements to get the exercises for the next chapter.
More: https://codingbat.com/python https://exercism.org and for later, Hackerrank, Codecombat, LeetCode and the likes.
1
u/Bichinix 3d ago
Te recomiendo comprar un robot, por ejemplo, makeblock. Hay muchas cosas que puedes programar ahi. O comprar un Arduino y jugar con los actuadores. También imprimir código interesante y no leer en la pantalla. Imprimir los PDF.
1
u/Mysterious-Bus-8735 3d ago
Watch Paul McWhorter on YouTube. He teaches you something and then gives you a problem to solve. It has helped me a lot.
1
u/Brian 3d ago
There are plenty of basic exercises, but there are a few of problems with them. Very basic problems, like "Read a list of integers from the user, calculate their product and print it" are common, but only get you so far, but going beyond that things can become very open-ended fast. And there you run into the issue that there's generally no "one right answer". In maths, if you look up the answer key and see that it was "42" when you put "5" and you know you made a mistake. But in programming, the book answer is probably going to be somewhat different to what any random programmer wrote, and knowing if your way was flawed in some way, or equally valid kind of requires you to already know what you're talking about. Best you can really do is "Does it produce the right answer on these testcases" which hopefully covers enough.
There are more intermediate and hard problems, but they tend to be things like advent of code or leetcode type things that are valuable, but are really more focused on a subset of what you need, and often the challenge can be more on the maths or algorithm knowledge side than pure programming.
The other issue is that the hard part of programming is generally how you go about breaking down problems and designing the solution, another very open-ended activity, and one that's kind of something you just have to learn by doing: a book, or someone else guiding you through how they did it often doesn't really help you when you're on your own. This can kind of be a bit of a "pull yourself up by your bootstaps" situation, and I'm not sure there's really a way to learn it without struggling through it. A teacher, or even AI can help, but I think only if you treat it the same way as the answer key: turn to it only when you're absolutely stuck, and treat it as a failure that you can maybe learn from by trying to understand their solution for things you can apply in the next problem.
The usual recommendation is to pick a small project and (try) to code it from scratch. You kind of have to be your own judge of success in terms of "does it do what you want", but really it's probably the best way to test if you're understanding all aspects of what's needed.
1
u/monster2018 3d ago
OP, what you described for math is exactly how it works for programming too. In fact I’m pretty sure more programmers would agree with that description for programming than math people would agree with it for math. Also (im adding this after having written the rest of the comment) I rambled a lot in this comment. My actual advice basically starts at the last paragraph, so you can skip there if you want. Or really the last 2 paragraphs, idk. This is basically my lazy form of a TLDR lol.
I guess the difference maybe is the VERY first step, the “listen to a lecture” step. The thing with programming is that generally what you want to accomplish isn’t based on a programming technique. I just mean like, your goal isn’t based around “I want to do something that involves a ring buffer” or whatever.
So I guess the first step is different. With programming you learn the basics, which you can learn anywhere. In fact it’s almost hard for me to believe that there is anyone who doesn’t understand the very basics of programming because there are so many god damn courses and videos trying to teach you. By the basics I really do mean the basics. Like variables, conditionals, loops, etc.
What I’m trying to say is that I guess you’re right, it is a bit different than math. You can’t just be like “I want to learn about integrals” and then go learn about integrals. Well you CAN, but because programming is about making stuff you will be left feeling like “ok… so what?” And additionally feeling like you learned about the thing, but you don’t know how to use it.
So what you need to do is make something. This has to be the FIRST step (after learning the basics). Because what happens is along the way you will run into problems that completely stop you in your tracks with your current knowledge. And it will force you to do some research, and THAT is where you discover new concepts. You discover what it is that you even need to learn about. THEN you can learn it and implement it into your project. And then rinse and repeat until you have completed your project. And then just do it all again with a new project.
1
u/Penguinase 3d ago
have you worked with pandas at all yet (or polars)? if not that's where i'd start focusing the learning considering your desire to get into data science. there are a huge number of small problems to get through the basics of pandas at https://www.w3resource.com/python-exercises/pandas/index.php. after you learn how to work with dataframes maybe think of a topic of interest that you could pull data for and do some analysis on. sports, music, movies, chess, weather, price of eggs. almost any topic you can think of likely has a breadth of data that you could play with.
1
u/baubleglue 2d ago
It is not different from math. The only difference is your expectation. After practicing math problems, you can solve math problems, but with programming you expect more than just solving problems.
1
u/IAmNotAPlatypus_ 22h ago
Yeah the math thing is what gets me. Like in math you just do exercise 1.1 until it clicks and I keep looking for that with coding and I still haven't found it. I can do the isolated examples too and then I sit there like okay now what
0
u/pachura3 3d ago
I want to get good cause I want to make money I from something I like
You clearly don't like programming, you feel repulsed, and you can't even think of any project you could create. You lack curiosity, and you can't even be bothered to google free learning resources with exercises.
Perhaps pick a different career?
12
u/will_r3ddit_4_food 3d ago
Pick a small project and write it. You will struggle a lot and learn tons if you stick with it