How to Learn Python on Your Own
There are a lot of free and cheap resources for learning Python. Here we provide some tips for finding the most popular up-to-date tutorials and books.
The first question you may be asking yourself is which version of Python you should be learning. The answer is almost definitely Python 3. Python 2, while still widely used, is the past. Python 3 is not only the future, it's the now. If you're just getting started learning Python, learn Python 3.
How to Choose a Python Tutorial
There are plenty of free Python tutorials to choose from on the web. There are generally two types:
- Tutorials that start with theory - These tutorials start by explaining why Python is so great, but they're likely to scare you into thinking that Python is extremely difficult to learn. It's not.
- Tutorials that start with code - We prefer this kind. They almost always start with a simple "Hello, World!" script that gets you using Python right away. Once you know how to do some fun stuff, you can go back and learn how Python is different from Java and what is meant by "high-level data structures" and "dynamic typing."
If you search Google for "Python tutorial", the likely first result is the tutorial on the official Python site. If you're already an experienced programmer, that might be a good place to start, but if you're not, we recommend you choose from one of the gentler Python tutorials below:
- Python 3 Basics Tutorial by Dr. Kristian Rother - a nice slow introduction to Python that will leave you wanting to learn more, which we believe should be the main goal of any introductory tutorial.
- The Python Guru - If you're using Windows, this is a nice, gentle tutorial to help you get started with Python. Skip the first chapter and jump right to the lesson on Installing Python.
- LearnPython.org interactive Python tutorial - If you can stand the ads, this tutorial gets you started with Python without having to install anything. However, if you really want to learn the language, you should go ahead and install Python. It's not that hard and it will make learning Python much easier.
How to Choose a Python Book
It seems like every week there is a new Python book released. On our last check, Amazon listed 1,131 Python books. Here's an excellent way to find a good introduction to Python book on Amazon.com. Once you identify the book you want, you can buy it from anywhere you like:
- Go to Amazon's Advanced Book Search.
- For Title, enter "Python".
- For Subject, select "Computers & Technology" so you just get books about Python programming (and not about snakes).
- For the Pub Date fields, enter "After", "Jan", "2014". This will ensure that most of the results are Python 3 specific and that they're recent enough so that all of the content in an introductory book will still be relevant. Python is mature enough so that most changes to the language are related to advanced concepts.
- For Sort Results by, select "Bestselling". You might be tempted to select "Avg. Customer Review", but that will result in a lot of noise as many of the books that have high average reviews only have a couple of ratings. So, your form should look like this:
- Press Search
- On the left-hand side of the resulting search results page, under Audience, click Beginners & Seniors to filter out the books targeting experienced programmers:
- Finally, select one of the top books that looks appealing to you. You may want to use the Look Inside feature and read some of the reviews to make sure it feels like a fit.
Or, if you just trust us, go ahead and buy Python Crash Course: A Hands-On, Project-Based Introduction to Programming by Eric Matthes.
And, of course, if you're looking for professional Python training, please check out our courses listed below.
Happy Python Learning!
- Checking the type of an object. A language must know the type of an object to know what can be done to it, what it can do and how it does the things it can do. For example, a number can be subtracted from another number, but text cannot be subtracted from a number.
- Dynamic Typing
- Typing that is done at run time. Dynamically typed languages, like Python, check the type of objects when they encounter them at run time. If your program tries to do something to an object that is not allowed, you will get an error when you run the program.
- Static Typing
- Typing that is done at compile time. Statically typed languages, like Java, check the type of an object when they are compiled. If your program tries to do something to an object that is not allowed, you will get an error when you compile the program, meaning that you won't be able to try to actually run the program until you fix the error and recompile.