r/CodingForBeginners • u/GrandImportance1676 • 4d ago
Beginner in Python coding, and coding in general, confused
Hi, I am learning python, and as a complete noob/beginner, from Kaggle courses. But I have hit the issue that I can't seem to understand what lines to write next, which command-thing to use, when to use them, i can't seem to remember. Any tips?
2
u/zztong 3d ago
I may not understand you correctly, but I think what you're asking about is how do you formulate an algorithm and then turn that into code.
If so, a classic starting point is for an instructor to have you write the instructions for how to make a Peanut Butter and Jelly Sandwich. Then they would collect your instructions and try to follow them, but they would be very literal. If you said "put the peanut button on the bread", then they might set the jar of peanut butter onto the unopened loaf of bread. You can see experience this as a class might with this video:
https://www.youtube.com/watch?v=FN2RM-CHkuI
But that's the beginning. You still have to get into thinking of algorithms. That is, steps to solve problems. Recipes. Directions. You know how to go to the grocery store. Right those down. What are the tools at your disposal for getting there? You can go forward, turn right, turn left, etc.
So now, to make the leap. The various "statements" you can make with your program language are your tools. The order you arrange them are the instructions. You can assign values to variables. You can make decisions, you can do repetitive things. Eventually you can get into how to store and organize more data. You'll have to explore some fundamental logic when you do decisions.
I hope that is the food for thought you needed.
1
1
u/stepback269 4d ago
As a beginner, you need to consider yourself a baby and learn to crawl (the "fundamentals") before you can stand up and walk or sprint. So search for the Python "fundamentals" on Google and/or YouTube.
As for a roadmap tailored to your needs, that's going to be difficult. Python is a vast and expansive universe. There is never going to be a "one" soulmate tutorial that works "best" for you and with regard to every aspect of Python. With each step up that learning curve, you're going to have to shop around until you find a teacher/resource that "clicks and sticks" especially for you.
With that said:
(1) There are tons and tons of tutorial materials out there on the net including many good YouTube ones that are free. You should shop around rather than putting all your eggs in one basket.
(2) As a relative noob myself, I've been logging my personal learning journey and adding to it on an almost-daily basis at a blog page called "Links for Python Noobs" (--HERE--) Any of the top listed ones on that page should be good for you. And there are many add-ons at the tail end of the page. Personally, I cut my first Python teeth with Nana's Zero to Hero (==HERE==). Since then, I've moved on to watching short lessons with Indently and Tech with Tim. You should sample at least a few until you find a lecturer that suits your style.
(3) The main piece of advice is the 80/20 rule. Spend 80% of your time writing your own code (using your own fingers and your own creativity) as opposed to copying recipes and only 20% watching the lectures. Good luck.
1
2
u/RedAndBlack1832 4d ago
What do you mean command-thing? Honestly you just get better by doing stuff. Try making something small like a calculator ("enter a number" "enter an operator" "enter a number").
2
1
1
1
u/GuruPentameter 3d ago
i tell my sons that when it comes to their studies, they don't need to remember anything if they understand.
the people who approach learning as a collection of memorization tasks are ineffective.
also, it sounds to me like you don't understand what a computer program is.
so, my tip for you is to start with that: understand instead of memorize, learn what a program does.
1
u/bibutt 3d ago
Unfortunately the most suitable projects for learning are also the most boring and will kill your passion to learn if you burn yourself out. Try cs50x and cs50p. Last I checked both of those courses were free and cover programming basics from scratch(literally) and the cs50p(do this 2nd) is specifically python programming.
0
-1
4d ago
[removed] — view removed comment
1
u/FindingNo2507 3d ago
But the thing that's bothering me is: why learn to code these days when AI exists ?
2
u/halfjmp 3d ago
There are two issues for a beginner: language syntax, and algorithmic thinking.
Start small.
The most important, by far, is algorithmic thinking. Try with small problems, like sorting, searching, generating permutations... But start with easy problems: search a value in an array, generate Fibonacci numbers...Don't stare at your computer until the code magically come up: no computer, just pencil and paper. Find the logic. If it's difficult, try, to write what happens on small cases and find patterns. And only when you have something that seems to run in your head, write the code on computer.
For the Python syntax, practice with small examples, and read the Python documentation: it's really great. You don't have to learn everything, but you have to totally master a few things: basic data types, control structures (if, for, while), functions. Then progressively learn library functions, when you need them. And know how to navigate the documentation. It's here: https://docs.python.org/3/ The most important parts are the Tutorial, Language Reference, Builtins Reference, and the Global Module Index. When you read about something in the documentation, try it. Never copy-aste from a web site including the Python documentation, but type everything (but you can copy-paste your own code when it makes sense).
Oh, and don't use AI. Read the documentation, type your own code.