Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

Python 

My vision on how to learn Python

Personally, I believe the best way to learn Python is not through following some book or tutorial but to simply try making something your own way and then comparing your code to that of someone else (preferably someone experienced in the programming language) who made the same project.

That's why I would say docs.python.org is the best source of information when learning Python (and the only one you'll ever need): it shows you all the functions while not spoonfeeding you with programs. With a little bit of common sense and some dedication, you can learn the language and in the end be a better programmer than the people who chose to be spoonfed: learning programming isn't just about knowing all the different functions, it's about being able to figure out how to put them all together on your own as well (you won't always have a step-by-step tutorial to guide you through the process).

That doesn't mean I dislike forums like these where users can go to ask for help with a certain problem, but it just hurts me to see that some people come here expecting others to hold their hand and guide them through the process step by step and that some people even take the time to do it without realizing it's actually lost effort.

For those who are reading this in order to receive guidance on how to get started, here are some projects that might be interesting to make, ordered from easiest to harder (please do not just look up a step by step tutorial on these):
  • Take a number chosen by the user and show its multiplications from 1 to 10 (e.g., 3 would be 3, 6, 9, 12, 15, 18, 21, 24, 27, 30.) Preferably with the exact format of the example (with a dot at the end, not a comma)
  • Display the numbers of Fibonacci until they exceed a number chosen by the user.
  • Make a shell-based calculator that takes three user inputs: two numbers and an operator.
  • Use a .txt file as a vocabulary list (word: definition) and interrogate the user on it by displaying the definition and asking for the word in a random order. Then, display the user's score along with the correct answers to any words they got wrong.
  • Make GUI-based versions of the previous programs using Tkinter.
  • Add threading to the Fibonacci project, so that it can go up to incredibly high numbers without taking too long.
If you're in need of some more projects, and others to compare your code with, there's a handy subreddit called /r/beginnerprojects that contains some useful stuff. Also, Google can definitely help you with some ideas. Good luck!
Personally, I believe the best way to learn Python is not through following some book or tutorial but to simply try making something your own way and then comparing your code to that of someone else (preferably someone experienced in the programming language) who made the same project.

You need to combine both imho. A good textbook will ensure that you learn proper coding habits and pick a programmer's mindset, but it's also trivial to apply what you learn by coming up with a project of your own.
I have short way to do this, bruteforce your brain.Read everything that related python and decide which one is more important to you that's all, lol.
(Apr 19, 2017 08:12 AM)CaptainBlack Wrote:  *Personally, I believe the best way to learn Python is not through following some book or tutorial but to simply try making something your own way and then comparing your code to that of someone else (preferably someone experienced in the programming language) who made the same project.*

You need to combine both imho. A good textbook will ensure that you learn proper coding habits and pick a programmer's mindset, but it's also trivial to apply what you learn by coming up with a project of your own.

I can definitely see how a combination of the two can be used, but I personally think it's better to discover things on your own and learn the proper habits by examining other people's code rather than by simply being told what to do. Everyone learns in a different way, in the OP I was simply saying what I believe to be the best way but that might not apply to you.

(Apr 19, 2017 08:24 AM)SIM-1866423 Wrote:  I have short way to do this, bruteforce your brain.Read everything that related python and decide which one is more important to you that's all, lol.

I'm sorry, what exactly do you mean by "and decide which one is more important to you that's all"? I don't really understand.
Your method is a bit like taking teaching someone how to swim by throwing them into the ocean a mile out and tell them that if they can make it to each booey they will get small pieces that will help them eventually make it to shore. Starting with a book or course would be like teaching a person how to swim by taking them to the shallow end of a pool and having an instructor giving them the fundamentals of swimming and some practices to enforce the basics before they move on to the deep end or the ocean.

I agree that after someone learns the fundamentals of not only Python but of Object Oriented Programming in general, then taking on projects is the best way to enhance skills and not always rely on books or python recipes.
(Apr 19, 2017 08:24 AM)SIM-1866423 Wrote:  I have short way to do this, bruteforce your brain.Read everything that related python and decide which one is more important to you that's all, lol.

I prefer this dudes way of learning, its how I originally got into hacking. If you can focus for a long time and not get bored, its the way.
(Apr 19, 2017 05:43 PM)[BLANK] Wrote:  Your method is a bit like taking teaching someone how to swim by throwing them into the ocean a mile out and tell them that if they can make it to each booey they will get small pieces that will help them eventually make it to shore. Starting with a book or course would be like teaching a person how to swim by taking them to the shallow end of a pool and having an instructor giving them the fundamentals of swimming and some practices to enforce the basics before they move on to the deep end or the ocean.

I agree that after someone learns the fundamentals of not only Python but of Object Oriented Programming in general, then taking on projects is the best way to enhance skills and not always rely on books or python recipes.

"throwing them into the ocean a mile out"
I'm sorry, but I disagree with this comparison. There's a huge difference between giving someone the very basic building blocks they need (docs.python.org, check my original post) to do some basic calculations with a user input to then move on to stuff that requires a few more functions each time and just throwing someone who can't swim into the ocean a mile out.

When you start off learning with the method I described in my original post, your habit in programming will be to find a way to make things work using just the documentations instead of just taking chunks of code from someone else. I believe that that's a much better idea than just spoonfeeding them their first projects, which every book I've read so far does.
When you have the mindset of taking your time to figure out how to make something work with only some basic information, that'll make you a better programmer because it'll be far easier for you to identify mistakes if you've trained yourself in doing that.
I didn't learn Python though any books. Reading books, in my opinion, is boring and tedious. I think the best way to learn is interactively and then try to create something, search things to learn new modules.
The real way to learn it is time, Its just like learning anything else takes time and practice.
(Apr 20, 2017 03:33 PM)DSTAT Wrote:  I didn't learn Python though any books. Reading books, in my opinion, is boring and tedious. I think the best way to learn is interactively and then try to create something, search things to learn new modules.

I completely agree (when it comes to programming, I don't agree that reading books is boring).
But let's be fair here, there is no real "best way to learn Python". There are many different ways and you just have to find the one that works best for you personally.
Agreed with sapience, you can't just formulate the best way to learn something. The human brain isn't like the computers we are working with in that we know everything about it to an extent. Each person learns differently so there is no real need to come up with "The best way to learn python" aside from helping the people who have tried other ways and couldn't.

For me, I think attempting to make something you want and then googling everything you don't know until you do know is the way to go because after a certain point, you won't be googling everything and you'll get practice in what you want to do.
BTC - 15Cn2u7onAuPaMFGmT4qbEhWgzsKSvMEn6
ETH - 0x5198A50b164a14Df7eAB562da7b440197cb9808B
[Image: folks.gif]
(Apr 19, 2017 08:12 AM)CaptainBlack Wrote:  You need to combine both imho. A good textbook will ensure that you learn proper coding habits and pick a programmer's mindset, but it's also trivial to apply what you learn by coming up with a project of your own.
Agree with this fella .. if you just start copy paste everything you google then you will never learn the concepts.. reading a good book or going through course will speed up the learning process in the long term and teach you good habits as well as all the do's and don'ts .
[Image: V9Gredc.png]
(Apr 21, 2017 08:40 AM)Malicious Intent Wrote:  Agree with this fella .. if you just start copy paste everything you google then you will never learn the concepts.. reading a good book or going through course will speed up the learning process in the long term and teach you good habits as well as all the do's and don'ts .

Where did you see anyone in this thread claim that copy pasting can teach you anything?
There's a huge difference between making something yourself using Python's own documentation to then go on and compare your code to other programmers' code and just copy pasting everything.
(Apr 21, 2017 08:43 AM)Sapience Wrote:  Where did you see anyone in this thread claim that copy pasting can teach you anything?
There's a huge difference between making something yourself using Python's own documentation to then go on and compare your code to other programmers' code and just copy pasting everything.

If you will try to create a project without any basic knowledge of syntax and concepts you will end up copy pasting everything as you won't understand how it works. Documentation can be tricky at times as you will probably realize soon enough.
[Image: V9Gredc.png]
(Apr 21, 2017 08:50 AM)Malicious Intent Wrote:  If you will try to create a project without any basic knowledge of syntax and concepts you will end up copy pasting everything as you won't understand how it works. Documentation can be tricky at times as you will probably realize soon enough.

If the whole c+p thing was in response to me, I don't mean google stuff to copy paste. When I started out by googling everything I normally check out SO, documentation, or examples and learn from that.

When I started on PyQt I copied and pasted some skeleton code and modified it to what I wanted. Now I could do the whole thing from scratch.
BTC - 15Cn2u7onAuPaMFGmT4qbEhWgzsKSvMEn6
ETH - 0x5198A50b164a14Df7eAB562da7b440197cb9808B
[Image: folks.gif]


Possibly Related Threads...
Thread / Author Replies Views Last Post
[Legends] by itcorpJul 29, 2026 01:40 PM 2 180 Jul 29, 2026 01:40 PM
Last Post: itcorp
[Python] by Bass_ReevesAug 20, 2023 01:44 AM 9 630 Aug 20, 2023 01:44 AM
Last Post: Lucky4L
[Python] by gravity_0Aug 20, 2023 01:32 AM 18 1,069 Aug 20, 2023 01:32 AM
Last Post: Lucky4L