How do I start learning Python?

It will depend on where you are starting from. What other skills do you have?

- Your education level. What majors?
- Your level of familiarity with computers/computing.
 
Since you are a beginner, I will recommend two websites where you can start.
1) https://www.geeksforgeeks.org/python-programming-language/
-- A great place, to learn every concept in deep. GFG is not just for python, but for every Language, Basics of computer science like data structures and Algorithms.

2) Codecademy.com
- This place have a practical way of teaching programming language. Here you can learn and immediately practice the programs which help to remember the syntax. You will not get much knowledge of Data Structures of Algorithm here though.

Consistency and practice is the way of mastering any programming language.
Good Luck
 
It will depend on where you are starting from. What other skills do you have?

- Your education level. What majors?
- Your level of familiarity with computers/computing.

I have done BTECH from tier-3 college in computer science. Actually, I had no interest in coding during college time. Now, I want to pursue my career in technical field in programming world. I have basic familiarity in computer programming languages.

Since you are a beginner, I will recommend two websites where you can start.
1) https://www.geeksforgeeks.org/python-programming-language/
-- A great place, to learn every concept in deep. GFG is not just for python, but for every Language, Basics of computer science like data structures and Algorithms.

2) Codecademy.com
- This place have a practical way of teaching programming language. Here you can learn and immediately practice the programs which help to remember the syntax. You will not get much knowledge of Data Structures of Algorithm here though.

Consistency and practice is the way of mastering any programming language.
Good Luck

Thank you for sharing the resource. Codeacademy provides a paid course. I'm not at that stage that I can afford that much money. GeeksforGeeks the first time I heard of it. It's a tough time for me to sit and learn any new things. Finance crisis. I'm looking for free resources thanks.
 
Thank you for sharing the resource. Codeacademy provides a paid course. I'm not at that stage that I can afford that much money. GeeksforGeeks the first time I heard of it. It's a tough time for me to sit and learn any new things. Finance crisis. I'm looking for free resources thanks.
Codeacademy provides a free Python 2 course.

The course for Python 3 is a paid one, but from what I gathered, you can still learn Python 2 and then move over to Python 3 later.
 
Recently I started coding python. but I would like to consider myself an expert at c++ so it was fairly easy for me. but here are the few observations that I think would help you.
1. Use pycharm community edition. dont even try anything else. not even visual studio code.
2. Its very easy to get carried away. so just focus on developing a project instead of practicing random stuff.
3. Dont reinvent the wheel, there is a python package to do almost everything and try to use them instead of writing your own.
4. Its pretty close to other scripting languages like perl or javascript and if you learn OOPS concepts, it will become very easy.
 
Recently I started coding python. but I would like to consider myself an expert at c++ so it was fairly easy for me. but here are the few observations that I think would help you.
1. Use pycharm community edition. dont even try anything else. not even visual studio code.
2. Its very easy to get carried away. so just focus on developing a project instead of practicing random stuff.
3. Dont reinvent the wheel, there is a python package to do almost everything and try to use them instead of writing your own.
4. Its pretty close to other scripting languages like perl or javascript and if you learn OOPS concepts, it will become very easy.

1. In my opinion use of IDE for beginners is really bad. They will never learn to fix their own mistakes and become too dependent on IDEs. Initially, one should stick to text editors, that simply gives you the line number and perhaps syntax highlighting and bracket matching. Atom, gedit, etc. Don't use IDE until its absolutely required.
2. Basic fundaments are more important. I would suggest investing 80% time on fundamentals and 20% time on side projects.
3. Re-implementing the wheel is important for learning. If you always call .sort, you will never understand how it's being done internally. You want to multiply two matrices, you can always use numpy but then you will miss the chance to fiddle with multidimensional arrays/lists. Once you have learnt, then sure go ahead with all the libraries you want. I say this because some people stereotype pythonists as dumb because there is a library for everything and you are not a real/skilled programmer if you use python. (Happened to me)
4. Python is OOPs, but not strictly required. However, OOPs concepts are important down the road.


Then again, it really depends on what the OP is trying to do and the level of depth he is trying to go into and needs. Feel free to correct me. :D
For learning, I would recommend the book 'Head First Python', it's an entertaining way to learn python and that's how I got started.
But the best resource for getting started is from Python themselves: https://www.python.org/about/gettingstarted/
 
my tips are the exact opposite:
1. go with what's easy for typing - you DON'T want to master the editor and python simultaneously! Editors have their own language for programming them - emacs has lisp, vi has vimscript and now perl/python but vi is modal so.. I use Kate BUT I would like to start with something with AutoComplete of the stdlib and an IDE is great assuming you can find one that works - lol
2. Don't waste your time implementing sort and algorithms initially! again, that's a seperate area of study.
3. Just start with Beazley and do the first 10-11 chapters - at least 2 passes AND MAKE brief NOTES BECAUSE you will forget it all.
4. Then go read the documentation on the python website! There's loads of it but you will get a much clearer understanding of how python works. (this is way too voluminous so start with the PEPs)
5. By this point you will keep bumping into use of standard library so that has to be mastered. (again Beazley has a book on it) especially re and it's match-object :p
6. By this time you will be dead or would have given up on python :p start looking for a job that uses python :p
it's a big and complicated language.. so try to make use of it - you will realize how ignorant you are - things you assumed about it will need to be corrected - make notes
(the important ideas are on how to use classes because python can be used like C - functional programming or like OOPS and here concepts like MixingClasses and MRO lookup and overloading start to bite you in the arse) (Beazley is a great book but you'll realize it's doesn't cover a lot it's still the world's best book on python - you got to actually try to write a program - I found wrting website scraping tools to be pretty useful because it involves program design) (also remember that in OOPS you have to create a vocabulary to describe your program - in C you do that clunkily using Abstraction so part of your effort with classes is to create words that are used in your program to do whatever it is you are trying to do)
7. python idioms - try to take a look at them - Eckel has a few

You will need to understand unicode btw and the difference between encoding, character-set, glyphs - I found usenet's python groups very helpful but you got to read Beazley first
 
Last edited:
1. In my opinion use of IDE for beginners is really bad. They will never learn to fix their own mistakes and become too dependent on IDEs. Initially, one should stick to text editors, that simply gives you the line number and perhaps syntax highlighting and bracket matching. Atom, gedit, etc. Don't use IDE until its absolutely required.
2. Basic fundaments are more important. I would suggest investing 80% time on fundamentals and 20% time on side projects.
3. Re-implementing the wheel is important for learning. If you always call .sort, you will never understand how it's being done internally. You want to multiply two matrices, you can always use numpy but then you will miss the chance to fiddle with multidimensional arrays/lists. Once you have learnt, then sure go ahead with all the libraries you want. I say this because some people stereotype pythonists as dumb because there is a library for everything and you are not a real/skilled programmer if you use python. (Happened to me)
4. Python is OOPs, but not strictly required. However, OOPs concepts are important down the road.


Then again, it really depends on what the OP is trying to do and the level of depth he is trying to go into and needs. Feel free to correct me. :D
For learning, I would recommend the book 'Head First Python', it's an entertaining way to learn python and that's how I got started.
But the best resource for getting started is from Python themselves: https://www.python.org/about/gettingstarted/
1. Not using an ide will require a new programmer to learn syntax. Learning syntax is totally useless skill to have. Language is just a tool and implementing an idea is more important than language.
2. my suggestion to work on a project is to stay focused. Learning a random thing is not really helpful if you can’t see it in real-time. I can give you an example w.r.t awk. Everyone knows how powerful awk is. I used to write awk statements which were really complex but today after few years if I have to write awk I just look at google for examples and get the stuff done. No point learning all the different awk commands that are possible.
3. learning algorithms is an another subject altogether. Requires understanding of math and such. Too much of a distraction. Exactly why they have a concept called abstraction in oops. I know there’s a craze these days about solving hacker rank and leet code problems but nobody does that in real life except for mathematicians.
Post automatically merged:

emacs has lisp, vi has vimscript
emacs is stupid and causes carpal tunnel syndrome. Vi FTW.
 
Requires understanding of math and such. Too much of a distraction. Exactly why they have a concept called abstraction in oops. I know there’s a craze these days about solving hacker rank and leet code problems but nobody does that in real life except for mathematicians.
I disagree, during Engineering we had subject called Analysis of Algorithms (AOA), another field which explains you in enough details without getting into math and such.

Their are plenty of books around AOA and interested parties can have a look to improve their understanding.
 
you can always check out 'Knuth - Art of Computer Programming - 1 Fundamental Algorithms' to determine for yourself what people mean when they say no Math :p

O notation requires familiarity with the exponential, cubic, quadratic and log curves at the very least.

IMHO learning a topic is a gradual and time consuming build-up ..Python has some very nice algorithm books Magnus Lie Hetland I liked especially for not being verbose and it's at least somewhat directly related to Python and Programming.
 
Did you tried reading up the books on AOA before you quote any author and tell us about Big O notation or what does Laplace transform or about Signal processing using Fourier transform.

When I said that their are books which are written in layman's terms for AOA. This for the starters to get grasp of the situation. It's the same issue - why people don't go for machine learning algorithms as few people on digital media mentioned that they need knowledge of maths (which is not true unless you get into Data Science, Stats and other part to support what you built-in to machine learning and extend it).

So see this from the beginner's challenge perspective and not as a intermediaries who are stuck)
 
Nikhil, could you link to some code you've written - any language - it's a good first step to see if a person has done something in the language - it doesn't detract from your advice on AoA but it does eliminate trolling and then it's just a genuine difference in opinion
 
Cool - if someone writes the code with reference to Metaplotlib and shares it - does it means a person has done something in the language.

If this is the case - here you go https://pastebin.com/1DGPVnDp

does eliminate trolling and then it's just a genuine difference in opinion
If it means trolling - it should be seen as people were bashing newbie who asked to get to know of Python but that person is nowhere to be seen and instead people like us discussing O notation and what not - don't you think this is same as trolling.

In Coding - its always been case of difference in opinion - people will find the issues with the current implementation and compare their approach to the solution seems better. I hope you understand why differences come in the discussion unless you have not done something into this. ;) :p
 
I'd rather not diverge from the threads goal and indulge in idle speculation not related to learning python - trolls generally want to go off-topic, typically on Freenode's #python which is quite a nice place.

matplotlib is a Python library to graph/plot data.

I find studying other people's code to be quite useful: for example, "Flask" is a Python library/framework that allows a programmer to quickly display/process data via the web. I prefer YAML but for web-apps JSON is the norm. Not that I am an expert on Flask - I've forgotten a bit.

@app.route is a Flask python-decorator that basically maps the URL to a function - it's event driven. When the Flask framework/code receives the URL request (the '/home.html' or whatever) on port/whatever, it will call your function with data as arguments to it. In fact Flask will wrap all the HTTP Headers and such in an object for you to use within your code.
"from flask import request"

One thing I found very different from Perl/C was this:
nlp = Nlp.NLP() #basically you are calling a class in the module Nlp and instantiating/creating an object but in perl you can always tell what a var-name is because it'll be $foo for scalar - the '$' indicates scalar/single-value variables - so in python figuring out the type is quite tricky and extremely annoying! Why? Because the methods you can call on the object depend on the type - in Python you can't tell what 'word' is.. so I have to make it 'words' vs 'word' or sometimes do l_x for list_x.

Another curious thing is
> if Text is None: #in python 'None' is an object - 1 object - there is only one "None" no matter the number of times you use it, so you are not doing a numerical comparison - it's not a variable! Typically in C we do numeric comparisons (checking for NUL/NULL) which is an integer value/macro/direct integer comparison. With None we are actually checking it's physical address (pointer address - kind off) - because there's only one None object ever, you can do that.
 
Back
Top