Python is an awesome programming language to learn– it is widely used in information science, software engineering, game development, and automation. However, what’s the best way to learn Python? This can be painful and difficult to work out.
One of the most annoying things in learning Python is how generic all of the learning tools are. If you want to learn how to make websites using Python, it seemed like every learning resource wanted you to spend two long, tedious months on Python syntax before thinking about doing what you are interested in. This mismatch made learning Python bothersome to many.
If you look at Python code, but it will seem confusing and foreign. But even a few lines of code can be confusing.
from django.http import HttpResponse
def index(request):
return HttpResponse("Hello, world. You're at the polls index.")
This code is from the tutorial for Django, a popular Python website development framework. Trained programmers will usually throw snippets like the above at you. “It’s easy!” they’ll promise.
Why are several lines indented? What’s Django.http? Why are a few things in Parentheses? Knowing how everything fits together when you don’t know much Python can be very hard.
The problem is that you will need to know the Python language’s building blocks to construct anything interesting. The above code snippet creates a view, one of the primary building blocks of a website using the famous MVC architecture. If you do not know how to write the code, it is possible to create a dynamic website.
Most tutorials pretend that you will have to learn all of Python syntax before you can begin creating anything interesting. This is what takes months spent just on syntax when what you really want to be doing is analyzing data, or creating a website, or building an autonomous drone.
This is what leads to your motivation melting away and just calling the whole thing off. We like to consider this as the “cliff of dull.” You will need to have the ability to scale the “cliff of dull” to make it into the “land of intriguing stuff you work on” (better name pending).
Therefore, we found a procedure that worked better for you all. In fact, we believe that is the best way.
The approach is to blend learning the fundamentals with building exciting things. Spend as little time as possible learning the basics, then immediately dove into creating something that you want. In this blog post, we’ll walk you through step by step how to implement this process.
Step 1: Find Out What Motivates You to Learn Python
Before you start diving, think about why you would like to learn it. It is worth asking yourself. It is going to be a long and painful journey. Without motivation, you won’t make it through. By way of instance, you slept through college programming and high school classes when I had to memorize syntax, and you weren’t motivated. On the flip side, when you had to use Python to create a site, you stayed up nights to complete it.
Finding out what motivates you will help you determine a route that gets you there and towards an end goal. You don’t need to figure out an exact project, a general area you are interested in as you prepare to learn Python.
Pick an area you are interested in, such as:
- Machine learning/ Data science
- Mobile apps
- Sites
- Games
- Robots/Hardware / Sensors
- Scripts to automate your job
Figure out one or two that interest you, and you are prepared to stay with. You will be equipping your learning towards them, and ultimately will be developing projects in them.
Step 2: Understand the Basic Syntax
Unfortunately, this step can not be skipped. Before you dive into your area, You’ve got to learn the basics of syntax. Since it isn’t very inspiring, you need to spend the amount of time on this.
Here are some helpful resources that will help you learn the fundamentals:
- Learn Python the Hard Way — a book that educates Python theories from the fundamentals to more in-depth programs.
- The Python Tutorial — the tutorial on the main Python Website
- Codeacademy — does a fantastic job of teaching basic syntax, and builds on itself nicely.
- Dataquest — Python Programming: Beginner Course — Dataquest teaches Python syntax in the context of learning data science. For example, you’ll know about for loops while analyzing weather data.
We can’t emphasize enough that you should spend the minimum amount of time possible on syntax. The faster you can get to work on projects, the quicker you will learn. When you get stuck, you can refer back to the syntax. You should ideally spend a few weeks with this phase and definitely no more than a month.
Step 3: Create Structured Projects
When you’ve learned the syntax, it is possible to begin doing projects. Projects are a terrific way to learn because they allow you to apply your knowledge. If you don’t use your knowledge, it is going to be tough to retain it. Projects will enable you to learn new things that will push on your abilities and help you build a portfolio.
However, very free form projects at this stage will be painful — you will need to refer to documentation, and you’ll get a lot. As a result, it is usually better to create structured projects until you feel comfortable enough to develop projects entirely on your own. Many learning resources provide structured projects, and these projects enable you to build interesting things in the areas you like while still preventing you from getting stuck.
Let’s look at some decent resources for structured jobs in each area:
Data Science/ Machine Learning
- Dataquest — Teaches you data science and Python interactively. You analyze a collection of interesting datasets that range from CIA files to NBA player stats. You finally build complex algorithms, including neural networks and decision trees.
- Python for Information Analysis — composed by the writer of a major Python data analysis library, is a good start to interpreting Python’s data.
- Scikit-learn Documentation — This is the primary Python machine learning library. It has tutorials and some documentation.
- CS109 — this is a Harvard course that teaches Python for data science. They have a few of their projects and other materials online.
Mobile Apps
- Kivy manual — Kivy is a tool that lets you create mobile apps with Python. They have a guide to help you get started.
Websites
- Flask tutorial — Flask is a popular web framework for Python.
- Bottle tutorial — Bottle is just another web framework for Python. This is the way to start with it.
- How To Tango With Django — A guide to using Django, a complicated Python web framework.
Games
- Codecademy — walks you through creating a few simple games.
- Pygame tutorials — Pygame is a favorite Python library for creating games.
- Making games with Pygame — A book that teaches you how you can create games in Python.
- Invent your own computer games with Python — a book that walks you through how to make several games using Python.
Hardware / Robots / Sensors
- Using Python with Arduino — learn how to use Python to regulate sensors connected to an Arduino.
- Learning Python with Raspberry Pi — construct hardware projects using Python and a Raspberry Pi.
- Learning Robotics with Python — learn how to build robots using Python.
- Raspberry Pi Cookbook — learn to build robots using the Raspberry Pi and Python
Scripts To Automate Your Work
- Automate the dull stuff with Python — learn how to automate daily tasks using Python.
When you’ve done a couple of structured projects in your area, you should have the ability to move into working on your projects. However, before you do, it is essential to invest some time.
Step 4: Work on Python Projects Independently
When You’ve completed some structured jobs, it is time to work to continue to learn Python better. Although you are consulting tools and learning theories, You’re going to be working on what you would like to work on. You need to feel errors and problems before you dive into working on your projects. Below are some resources you should be familiar with:
- StackOverflow — a community question and answer site where folks discuss programming issues. You can discover Python-specific queries here.
- Google — the most widely used tool of every experienced developer. Very useful when trying to solve errors.
- Python documentation — a fantastic place to find reference material on Python
Once you have a handle on debugging issues, you can begin working on your own projects. You should work on projects that interest you.
Here are some strategies for finding interesting projects:
- Expand the projects you’re working on previously, and add more functionality.
- Visit Python meetups in your region, and discover people that are working on interesting projects.
- Find open-source packages to contribute to.
- See whether any regional nonprofits are searching for volunteer developers.
- Find projects other individuals have made, and see whether it’s possible to expand or adapt them. Github is a fantastic place to get these.
- Go through other people’s blog posts to find interesting project ideas.
- Think of resources which would make your everyday life easier, and construct them.
Remember to start small. It’s often helpful to begin with, simple things so you can get confidence. It’s far better to start a small project that you finish that a large project that never gets done. In Dataquest, they have guided projects that provide you with small data science-related projects that you can build on.
It’s also helpful to find other people to work with for more motivation.
If you really can not think of any great project ideas, here are a few in each area we have discussed:
Data Science / Machine Learning Project Ideas
- A map that highlights election polling by state
- An algorithm that forecasts the weather where you live
- A tool that expects the stock exchange
- An algorithm that automatically summarizes news posts.
Mobile App Project Ideas
- An app to monitor how far you walk daily.
- An app that sends you weather alarms.
- A realtime location-based chat.
Website Project Ideas
- A website that can help you plan your weekly meals.
- A site that enables users to review video games.
- A notetaking platform.
Python Game Project Suggestions
- A location-based mobile game where you catch territory.
- A game in which you program to solve puzzles.
Hardware / Sensors / Robots Project Ideas
Sensors that monitor your house temperature and enable you to monitor your home remotely.
- A smarter alarm clock.
- A self-driving robot that finds obstacles
Work Automation Project Ideas
- A script to program data entry.
- A tool to collect data from the web.
The key is To pick on something and take action. There is a risk you will never make if you get too hung up on choosing the project.
Step 5: Keep working on more challenging projects.
Keep increasing the scope and the difficulty of your projects. It means it is time to try something harder if you are entirely comfortable with what you are building.
Here are some thoughts for when that time comes:
- Try teaching a newcomer on how to build a project you made.
- Can you scale up your own tool? Could it work with more data, or can it handle more visitors?
- Can you make your app run faster?
- Can you create your tool useful for more people?
- How would you commercialize what you’ve made?
Moving Ahead
Python is evolving all of the time. Only a couple of people can claim to understand the language, and they created it.
You’ll need to be keep learning and working on projects. If you do this right, you will end up looking back in your code 6 weeks ago and considering how terrible it is. You’re on the right path if you get to this stage. Working only on things that interest you indicates that you’ll never get bored or burned out.
Python is a rewarding and enjoyable language to learn, and we believe anybody can get to a high level of proficiency in it if they find the ideal motivation.