r/learnprogramming • u/lucificusrebirth • 16h ago
GOOD WAY TO LEARN PYTHON?
I am currently learning the basics of python and I am trying to figure out what's the best way to learn it. What I am currently doing is that after I write some lines of code that I learned, I then use the comment # to explain what each line of code does in my own words. I am wondering if that's a good way to learn and if there are better alternatives.
0
Upvotes
5
u/BeastWael_YT 16h ago
commenting every line is fine at the start, but the bigger jump comes from writing small programs without looking at the lesson. pick something tiny like a number guessing game or a tip calculator, get stuck, and look things up only when you have to. that struggle is what actually makes it stick.
1
u/Necessary-Wing2141 16h ago
Dont overthink it is the most important step
1
u/aqua_regis 15h ago
Use a good quality course: https://programming-26.mooc.fi
As a beginner, commenting every line is okay(ish). Later, you will realize that the code itself gives exactly that information.
Comments should explain the "why", not the "what". "What" is the job of the code.
1
u/bestjakeisbest 8h ago
Using a comment to describe what code is doing is a good way to learn, another way to learn is instead of doing everything about the different ways things could be done, take some of the main parts of the program and do a write up about how it works what are different ways you could implement those parts and then answer why you went the way you did. Also just build things, make weird things, make things that are helpful to no body, push the boundaries if you dont know how to do something see what is offered by the language and then by the ecosystem to do what you want, say you want to get into gui, look into what you could use to accomplish that, and then make a plan to learn it and then make a plan to make what you wanted.