How to Learn Python (Step-By-Step) in 2022
How to Learn Python (Step-By-Step) in 2022
Why Should You Learn Python?
Python is one of the most popular and in-demand programming languages in the world, and it’s here to stay.
But what’s the best way to learn Python?
That can be difficult and painful to figure out. Unfortunately, I know this from experience.
A little over a decade ago, I was just a college graduate with a history degree. I then became a machine learning engineer, data science consultant, and now CEO of Dataquest.
However, my journey to learn Python was long, inefficient, and frequently discouraging.
If I could do everything over, I would follow the steps I’m going to share with you in this article. It would have fast-tracked my career, saved me thousands of hours, and prevented a lot of stress.
I created this guide to help people who are in the same position I was in. It’s also why I founded Dataquest. Our interactive Python courses can take you from complete beginniner to job-ready using actual code in months.
However, courses aren’t enough. You need to know how to think, study, plan, and execute effectively if you want to learn Python. This guide contains everything you need to know.
Is Python Really That Difficult?
When I was learning, I found most of the Python courses and resources were too generic.
Right away, I wanted to learn how to make websites using Python. But the Python learning resource wanted me to spend months on syntax before they got into what interested me.
This barrier felt intimidating and daunting. I put it off for months. Whenever I started a Python course, I quickly lost interest. Python code continued to look foreign and confusing, like this:However, to some beginners, this code might as well be an alien language.
Most Python tutorials assume that you need to learn all of Python syntax before you can start doing anything interesting. But that’s boring! Instead, you probably want to be analyzing data, or building a website, or creating an autonomous drone with artificial intelligence.
All that time spent on syntax saps your motivation, and most people give up.
I like to think of this as the “cliff of boring”. You need to be able to climb the “cliff of boring” to make it to the “land of interesting stuff you work on” (better name pending).
Learning Python Doesn’t Have to be Painful
After many failed attempts, I found a process that worked better for me. In fact, I think this is the best way to learn Python programming.
First, I spent as little time as possible memorizing Python syntax.
Then, I took what I learned and immediately dove headfirst into a project I actually found interesting.
Following this process is not only much more fun, but it allows you to learn at an incredible rate.
Step 1: Figure Out What Motivates You to Learn Python
Before you start, it’s worth asking yourself why you want to learn Python programming.
At times, your learning experience will be boring and monotonous. To successfully make it through those stages, you need to anchor yourself by focusing on things you’re highly interested in.
As a beginner, I struggled to keep myself awake when trying to memorize syntax. However, when I needed to apply Python fundamentals to build an interesting project, I happily stayed up nights to finish it.
To get started, find one or two areas that interest you. Some projects that you might find interesting are:
Data science / Machine learning
Mobile apps
Websites
Computer science
Games
Data processing and analysis
Hardware / Sensors / Robots
Scripts to automate your work
Step 2: Learn the Basic Syntax
Unfortunately, this step can’t be skipped. But you can spend the minimum amount of time on this, as it isn’t very motivating.
Here are some good resources to help you learn the Python basics:
Learn Python the Hard Way — a book that teaches Python concepts from the basics to more in-depth programs.
Dataquest – Python for Data Science Fundamentals Course — I started Dataquest to make learning Python and data science easier. Dataquest teaches Python syntax in the context of learning data science. For example, you’ll learn about for loops while analyzing weather data.
The Python Tutorial — the tutorial on the main Python site.
I can’t emphasize this enough: Only spend the minimum amount of time possible on syntax.
The sooner you can get to work on projects, the faster you will learn. You can always refer back to the syntax when you get stuck later. Ideally, you will spend a couple of weeks on this phase, but no more than a month.
Quick note: Learn Python 3, not Python 2. Unfortunately a lot of “learn Python” resources online still teach Python 2, but you should definitely learn Python 3. Python 2 is no longer supported, so bugs and security holes will not be fixed!
Step 3: Make Structured Projects
Once you’ve learned the basic Python syntax, start doing projects on your own. Until you apply your knowledge, it will be hard to remember everything you’ve learned.
Projects will stretch your capabilities, help you learn new Python concepts, and it will help you build a portfolio to showcase your abilities to potential employers.
It’s better to begin with structured projects until you feel comfortable enough to make projects on your own. Here at Dataquest, virtually all of our Python courses contain structured projects to help you apply what you’ve learned.
Some additional recommended resources for structured projects are:
Data science / Machine learning
Dataquest — Teaches you Python and data science interactively. You analyze a series of interesting datasets ranging from CIA documents to NBA player stats. You eventually build complex algorithms, including neural networks and decision trees.
Python for Data Analysis — written by the author of a major Python data analysis library, it’s a good introduction to analyzing data in Python.
Scikit-learn documentation — Scikit-learn is the main Python machine learning library. It has some great documentation and tutorials.
CS109 — this is a Harvard class that teaches Python for data science. They have some of their projects and other materials online.
Mobile Apps
Kivy guide — Kivy is a tool that lets you make mobile apps with Python. They have a guide on how to get started.
Websites
Bottle tutorial — Bottle is another web framework for Python. This is how to get started with it.
How To Tango With Django — A guide to using Django, a complex Python web framework.
Games
Pygame tutorials — Pygame is a popular Python library for making games, and this is a list of tutorials for it.
Making games with Pygame — A book that teaches you how to make games in Python.
Comments
Post a Comment