Codementor Events

How long does it take to learn Python?

Published Jul 08, 2020Last updated Sep 28, 2021
How long does it take to learn Python?

In this article I will talk about how long does it take to learn python as a first programming language. I will provide you with the steps you should follow, in other words, the things you need to learn and roughly how much time you need to spend on each.

Actually learning a programming language doesn’t take long. As a beginner, the toughest obstacle is shifting to think in an algorithmic way. This means being able to decompose a task, or action is smaller steps.

decompose-task-300x212.png

For example, let’s say you want to walk. It sounds like a simple task, but what if you have to explain how to walk to a robot. You need to think carefully about every single thing you do. To take a step, firstly you need to shift your weight to the left, then lift your right leg. Move your right leg forward, etc

Once you have gathered all steps, you need to express this smaller steps in terms that the robot understands. That’s what programming is all about.

Another obstacle is that you don’t know what exactly you need to learn. Therefore you end up wasting a lot of time googling stuff, trying to figure out what’s important and what’s not important.

This is a bit like trying to cross a forest, if you know the path to cross, you just need to follow it, easy!! however if there is no path, as soon as there is a diversion you may get lost, start walking in circles and waste time. That’s why I think having a roadmap is so important

roadmap-300x212.png

How fast can you learn python?

You could learn python well enough to get a job in 4 months, if you are committed and work on it at least 5 days per week. Does it sound like too long? I could tell you, it’s gonna take you one month, however that’s not realistic at all. Plus I don’t think it’s achievable since some of the concepts you need to learn have to be assimilated, and that just takes some time.

Keep in mind, this timeline are referring to a normal person, just like myself, with average intelligence and other stuff and responsibilities beside learning programming in their life. I am sure there are people out there, with exceptional abilities that can achieve this goal much quicker.

How to break down these 4 months?

Here are the things you need to learn during these 4 months

Basics

The basics means you need to install python, learn what variables are, if statements also known as conditionals, loops and functions. Simple stuff, however this is the base for anything else you learn. It’s important that you understand these concepts and how to use them well, before moving on to more advanced stuff.

Covering the basics and doing at least 20 code challenges to make sure your understanding is solid, should take you about 2 weeks. Assuming you apply yourself for 5 days a week, at least one hour per day.

I would advice you to avoid trying to squeeze the 5 hours in one single day. Why? There are concepts that need to be assimilated. Therefore I don’t think doing all the work in 1-2 days and not working for next 5 days will work. The consistency is quite important for this plan to work.

consistentcy-300x212.png

Also, it is important you choose code challenges that match you skill level, to avoid being discouraged. If you start working on a challenge and find yourself not being able to solve it, don’t get stuck.

Basics Total working days: 14 days spread across 3 weeks

Probably you are not ready for that problem, just yet. Move on to something easier and don’t get discouraged. It’s like trying to run a marathon after your first day at the gym, not the right time! 🙂 Give yourself time to develop you skills, and be fair and reasonable with yourself.

Starting out with Python - Learn the basics

Data Structures, Object Oriented Programming and Algorithms

Once you cover the basics, next thing to learn Data Structures, Object Oriented Programming and Algorithms. The first two are quite important. The third one not as important. Algorithms means knowing the sorting and searching algorithms, and the graph algorithms, BFS and DFS. I don’t mean that algorithms are not important, they are. However you could pass a junior interview without knowing much about algorithms

Why are Data Structures and Object Oriented Programming (oops) so important? They will help you to handle larger amount of data more efficiently, in other word, faster. And one of the main benefits in OOP is that it helps you to **organise your code in a logical way, so your code easier to maintain.

I have seen beginners trying to write intermediate level problem without data structures or oops and it is just not possible. The code becomes a real unmanageable monster really, really quickly.

I think you can learn these three things in about 15 days, a bit more than 2 weeks. Here is how I will break down these 15 days.

  • Basic Data Structures(in python): list, tuple, dictionary, sets – 3 days including doing coding challenge

  • Stack and Queues, Trees and Graphs : 4 days including exercises.

  • OOP : Creating Classes and objects : 2 days, half of the session for theory and then start with the exercises

  • **OOP : Inheritance, Composition, Encapsulation, Polymorphism **– 3 days. Cover the theory in half session and then do exercises for 2 days.

  • Algorithm: Sort and Search algorithm and graph algorithms. I will dedicate 3 days to this. Learning the algorithms and then try to implement some of them

Data structures, OOP and algorithms Total working days: 15 days spread across 3-4 weeks

Get started with data structures in Python

Get started with Object Oriented Programming

Control Version and Small Project

If you get to this point you have made really amazing progress, and you should be quite proud. Next thing I will advice you to learn is some control version mechanism like Git.

Control Version means that you upload your code to a website or platform, to save your code and also to keep history of the changes you made in your code. Why is this important? Most companies use version control to save
the code of their systems and keep track of the changes made. Also it allows teams to work on the same application. Any company will expect you to know this. My advice is using GitHub because is free and it is used by many companies all over the world.

I would say learning GitHub may take, 2 or 3 days, you don’t need to know everything, just the basic stuff. Create a repository, upload your code to the repository. Make a change to the code and upload it to the repository.

Once you covered GitHub, it is time to pick a small project to work on. Just something small you can finish in a one week. Personally I will
create a game using pygame. You can create a tetris, a memory card game, or any other game you like. I think creating a small project is important because it gives you a chance to apply all that you learnt in something real and get motivated to continue.

Some ideas for beginners projects

Control Version and Small Project Total working days = 10 days spread across 2 weeks

At this point you have been learning programming for about 38 days, which will spread across 8 weeks. Probably you get stuck at some point, so give yourself 2 extra weeks. If you have been consistent, working 5 days a week you should have a solid understanding about programming, so what’s next?

Web Development

Most developers in one way or another have to deal with web component. Certainly if you are a web developer, but even if you work on a desktop application. A desktop application is likely to fetch data from another system over the internet. Therefore understanding the web basics is quite important as a developer.

What do I mean by web basics? Understanding what HTML and CSS are and what is a web server. I will dedicate 5 days to this and create a few html file with different structures. There are a few free resources like codeacademy.com. You don’t need to get into much details and create beautiful sites. Just the basics is enough.

One you understand how to create the structure of a website, you can learn a python web framework like flask or django. I will advice flask to start. Why? It is more beginner friendly, however eventually you want to learn django, just because it is in higher demand.

With flask you can start a web server, that will serve your html and css file. I will spent 7 days learning flask and building a simple website, without database. Just using some in memory data structure, to keep things simple. Keep in mind, many of the concepts you learn while creating this website, will be useful in case you want to learn django later.

Create a hello word web application with Flask

Web Development Total working days = 19 days spread across 4 weeks

Databases

And last but not least you will need to learn databases. A program will used a database to save data and persist the data after shutting down the program, or server.

Any application will need a database to save and retrieve data. Therefore as a developer you ned to know how to create tables in a database, retrieve, update, create and delete data in a database. And how to access a database from an application.

There are relational and non-relational. I will pick relational databases just because that will be enough to get a job.

What exactly you need to know about databases? SQL, which is the language to access relational databases, like MySQL or posgress(both are free). Once you learn SQL you need to learn how to use a python library to access a database, for instance sqlite3.

How long should you spend on databases? I will say 3-4 days for learning SQL and Sqlite and I will spend a few more days, maybe 4 days, for integrating the website you created with a brand new database.

Databases Total Working Days = 8 days spread across 2 weeks

Adding all the weeks up this plan will take about 14 weeks, 3 months and 2 weeks. At some point you may get stuck, therefore probably good adding 3 extra weeks to deal with anything unexpected. That give you a total of 4 months and 1 week.

And that’s all! After following these steps you will have a good understanding of how to create a full application using python.

Hope you enjoy the articles! and thanks for your time!
Happy coding! 😃

More Programming Articles

How to convert XML to JSON in Python – Ultimate guide

How to Check Django Version – Ultimate Guide 2020

Discover and read more posts from Marta Rey
get started