Guide · Technology
How to Learn Python as a Beginner: A Step-by-Step Roadmap
Python is the most common first language, but most beginners get stuck in tutorials. This roadmap shows what to learn in order, which projects to build, and how to go from basics to a job-ready skill.
For
Complete beginners, students and career switchers who want to learn Python properly.
Level
On this page
Key takeaways
- Python is a good first language: readable, widely used and useful in data, automation, web and AI.
- Learn in order: basics, functions, data structures, files and errors, then libraries and a path.
- Write code every day. Typing and debugging teach more than watching.
- Build small projects early and bigger ones later. Projects are your proof.
- Choose a path after the basics: data, automation, web or AI. Don't try all four.
You have decided to learn Python. You watched a 10-hour video, followed along, and felt fine. Then you tried to write a program from scratch and froze.
This is the "tutorial trap", and it affects nearly every beginner. The fix is a roadmap that mixes learning with building from the first week.
Why Python
#- Readable: the syntax looks close to plain English.
- Versatile: data analysis, automation, web backends, scripting and machine learning.
- Big community: a huge amount of help, libraries and jobs.
- Good for beginners: it lets you focus on thinking, not on syntax.
It is not the fastest language, and it isn't the best for phone apps or low-level systems. But for a first language it is hard to beat.
Before you start
#- Install Python 3 from python.org, and a code editor such as VS Code.
- Learn to run a file from the terminal:
python hello.py. - Create a folder for your practice, and use Git to save your work. See Git for beginners.
- Set a schedule: 45 to 60 minutes daily is better than a long weekend session. See deep work and focus.
Stage 1: The basics (weeks 1 to 3)
#Learn:
- Variables and types: numbers, strings, booleans
- Input and output:
print(),input() - Operators: arithmetic, comparison, logical
- Conditions:
if,elif,else - Loops:
for,while,break,continue - Strings: slicing, formatting (f-strings)
Practice:
- A tip calculator
- A number guessing game
- A program that prints a multiplication table
- A simple password strength checker
Stage 2: Functions and data structures (weeks 4 to 6)
#Learn:
- Functions: parameters, return values, scope
- Lists, tuples, sets and dictionaries: when to use each
- List comprehensions
- Sorting and searching in lists
- Nested data: lists of dictionaries
Practice:
- A contact book using a dictionary
- A word-frequency counter for a text
- A to-do list in the terminal
- A function that checks whether a word is a palindrome
Stage 3: Files, errors and modules (weeks 7 to 8)
#Learn:
- Reading and writing files, including CSV and JSON
- Exceptions:
tryandexcept - Modules and packages, and
import - Virtual environments and
pipfor installing libraries - Reading error messages. See how to debug any bug
Practice:
- Read a CSV of expenses and total them by category
- Save and load your to-do list from a file
- A script that renames many files in a folder
Stage 4: Object-oriented basics and good habits (weeks 9 to 10)
#Learn:
- Classes and objects, attributes and methods
- Basic testing with
pytestorunittest - Code style (PEP 8) and writing readable code
- Using the debugger in your editor
Practice:
- A bank account class with deposit and withdraw
- Write tests for one of your earlier programs
Stage 5: Choose a path (weeks 11 to 20)
#After the basics, choose one direction.
Path A: Data and analysis
#- Learn pandas and NumPy, and charts with matplotlib.
- Learn SQL. See SQL for beginners.
- Project: analyse a public dataset and write up your findings.
- Next: data analyst roadmap.
Path B: Automation and scripting
#- Learn the
requestslibrary, web scraping basics (check a site's terms first),osandpathlib,openpyxlfor Excel and simple scheduling. - Project: a script that downloads a report, cleans it and emails a summary.
Path C: Web backend
#- Learn Flask or FastAPI, how HTTP works, and databases. See how a website works and what is an API.
- Project: a simple notes or expense API with a database.
Path D: AI and machine learning
#- Learn statistics basics, then scikit-learn. Later explore deep learning and large language models. See how AI chatbots work.
- This path needs more maths and time. Start with data skills first.
Projects that build your portfolio
#Start small, then grow:
- Beginner: calculator, quiz game, expense tracker in the terminal
- Intermediate: a weather app using a public API, a CSV report generator, a Telegram bot
- Portfolio-level: a data analysis with a clear question, a small web app with a database, an automation that saves real time
For each project:
- Put the code on GitHub with a clear README
- Describe the problem, how to run it and what you learnt
- Keep commits tidy
Share what you learn. See writing in public.
How to practise without getting stuck
#- Type the code, don't copy and paste.
- Predict the output before you run a program.
- Change the example to do something different.
- Struggle for 20 to 30 minutes before looking at a solution.
- Use the official docs and read error messages carefully.
- Review old code after a week and improve it.
- Practise problems on sites such as HackerRank, LeetCode, Codewars or Advent of Code.
- Use spaced review for syntax and concepts. See spaced repetition.
Using AI tools well
#AI assistants can explain errors, suggest approaches and review code. But if you let them write everything, you won't learn. A good habit:
- Try on your own first.
- Ask for an explanation or a hint, not the full answer.
- Type the solution yourself and run it.
- Ask it to quiz you on what you learnt.
See learning to program in the AI era and writing better AI prompts.
From learner to job
#- Build 3 solid projects in your chosen path.
- Learn Git, SQL and basic Linux.
- Practise interview problems. See software interview preparation.
- Update your resume and LinkedIn. See resume guide.
- Apply for internships, junior roles and freelance work.
- If you come from another field, see career switch into IT or data.
Common mistakes
#- Watching tutorials without coding
- Jumping between languages
- Skipping fundamentals to learn frameworks
- Avoiding errors instead of reading them
- Building nothing
- Comparing yourself with others
- Not asking for help after getting stuck for hours
A sample weekly plan
#Day | Activity |
|---|---|
Mon to Thu | 45 minutes: learn a concept and do exercises |
Fri | 45 minutes: review and fix old code |
Sat | 2 hours: work on a project |
Sun | Rest, or 30 minutes of reading |
Frequently asked questions
#How long does it take to learn Python?
#Basics take 6 to 10 weeks of steady practice. Becoming job-ready usually takes 6 to 12 months, depending on the path and time you spend.
Do I need to be good at maths?
#Not for basics, web or automation. Data science and machine learning need more maths over time.
Python or JavaScript first?
#Python is gentler for many beginners. If you want to build websites, JavaScript is essential. Choose based on your goal.
Are certificates useful?
#They can help a little. Projects and problem-solving matter more.
Can I learn Python on my phone?
#You can read and practise basics, but a laptop is much better for real work.
Library names and versions change. Check the official documentation for current details.
Sources & further reading
Connected reading
References
- Writing a Resume That Survives the First 10 Seconds
- Writing in Public: How to Learn Faster and Be Found by Opportunities
- How to Switch to an IT or Data Career at 25 to 35 Without Starting Over
Show all 15 →
- Software Interview Preparation: A 6-Week Plan That Actually Works
- Deep Work: How to Focus for Two Hours in a World of Notifications
- Spaced Repetition: Remember What You Study Without Re-reading It
- Git for Beginners: The Handful of Commands You Actually Need
- How to Debug Any Bug: A Calm, Repeatable Process
- How to Learn Programming When AI Can Already Write Code
- SQL for Beginners: Learn to Query a Database With Real Examples
- What Is an API? A Plain-English Explanation With Real Examples
- How a Website Works: From Typing a URL to Seeing the Page
- Writing Better AI Prompts: A Practical Guide
- Data Analyst Roadmap: Skills, Tools and Projects to Get Your First Job
- How Do AI Chatbots Like ChatGPT and Claude Actually Work?
Linked from 4 guides
Other pages in the library that point here.
Share this guide

