Skip to content
MintFlow Articles

How to learn Python: a step-by-step plan for beginners, using free courses

One free course, the right setup for Windows, Mac or Linux, a 16-week schedule and the projects that make it stick

On this page
  1. How to learn Python: the plan at a glance
  2. Step 1: Pick one free Python course
  3. Step 2: Install Python 3.15
  4. Windows 10 and Windows 11
  5. macOS
  6. Linux
  7. Step 3: Choose an editor and run your first program
  8. Step 4: Learn the core ideas in this order
  9. Step 5: Follow a 16-week schedule
  10. Step 6: Use virtual environments and packages
  11. Step 7: Choose a direction
  12. Should you use AI while learning Python?
  13. How long does it take to learn Python?
  14. What should you do when you get stuck?
  15. Frequently asked questions

The best way to learn Python is to follow one free beginner course from start to finish, write code every time you sit down, and begin your own small projects before you feel ready. For most people that course should be Harvard's CS50P, which is free, assumes no experience and runs in your browser. Plan on roughly 80 hours for the basics, or about 16 weeks at five hours a week.

You don't need to pay for anything or own a powerful computer. You do need to stick to one course.

How to learn Python: the plan at a glance

  1. Pick one main course and ignore the rest until you finish it.
  2. Install Python 3.15 from python.org, or start in a browser and install it later.
  3. Choose a simple editor. IDLE or Thonny for the first weeks, VS Code after that.
  4. Learn the core ideas in order: variables, conditions, loops, functions, lists and dictionaries, errors, files.
  5. Build something small as soon as you can write a function.
  6. Add the tools working programmers use: virtual environments, packages and tests.
  7. Choose a direction (automation, data, web, AI) and build a second, bigger project in it.

Python is a sensible first language because it's used so widely. It was first in the TIOBE index in November 2026 with a rating of 20.86%, though that was down 2.51 points on a year earlier. In Stack Overflow's 2026 Developer Survey, 58% of respondents used it, which put it fourth: JavaScript led at 62%, with SQL and HTML/CSS a fraction of a point ahead of Python. GitHub's Octoverse 2026 report ranks it second by contributors, behind TypeScript.

Step 1: Pick one free Python course

These are the ones we'd choose from. All of them are free to study, and the main differences are format and pace.

Resource Format Cost Best for
CS50P (Harvard) Video lectures, graded problem sets, final project Free, including the CS50 Certificate Most beginners
Python for Everybody (py4e.com) Videos, book, autograded assignments Free on py4e.com; the Coursera version is paid A slower pace
Automate the Boring Stuff with Python, 3rd edition Book Free online; No Starch lists print at $59.99, ebook at $47.99 Office and file chores
Python Programming MOOC 2026 (University of Helsinki) Text and many exercises Free Lots of practice
freeCodeCamp Python Certification Interactive lessons, five projects, exam Free, including the certification Short interactive lessons
Think Python, 3rd edition Book as Jupyter notebooks Free online Reading and running code side by side

CS50P (full name: CS50's Introduction to Programming with Python) is our pick. Harvard lists it as nine weeks at 3 to 9 hours a week. It goes from functions and variables through loops, exceptions, libraries, unit tests, files and regular expressions to object-oriented programming, then a final project. You work in cs50.dev, a cloud version of VS Code, so there's nothing to install on day one, but you'll need a GitHub account. The free CS50 Certificate requires at least 70% on every problem and on the project, plus a free (audit) registration on edX, and the current edition closes on 30 June 2027. edX also sells a verified certificate, which you don't need. We found conflicting prices for it: one edX page lists $199, Harvard Online's listing has shown more, and edX says CS50 certificates typically cost $50 to $300. Check the amount on edX before you pay.

Python for Everybody, by the University of Michigan's Charles Severance (Dr. Chuck), starts from zero, with setup and a "Why Program?" lesson, and works up to web services, databases and data visualization. Use py4e.com if you want it free. Coursera's FAQ says you can't take its version for free, though you can apply for financial aid.

Automate the Boring Stuff assumes zero programming knowledge and gets to useful jobs quickly: spreadsheets, PDFs, web scraping, email. One catch is that the third edition teaches with the Mu editor, which is no longer maintained (its repository was archived on 31 August 2025). Mu still works, according to its site, but we'd use IDLE, the book's own backup choice, or Thonny instead.

Helsinki's MOOC has 14 parts, with the first seven making up Introduction to Programming. The 2026 edition is only open until the end of 2026, so if you're starting now, check mooc.fi for a 2027 edition. We couldn't confirm one yet.

Two more to know about. The official Python Tutorial is excellent, but it says it's meant for programmers who are new to Python, not people new to programming, so save it for later. Exercism's Python track (free, 146 exercises, volunteer mentors) is for practice alongside a course. Exercism itself points complete beginners to its separate Jiki platform.

Step 2: Install Python 3.15

Get Python 3, and take the latest stable version, which is 3.15 right now. The 3.15 series came out on 9 October 2026 and gets support until October 2031. Python 3.14 is fine too, and a course recorded on an older Python 3 will still teach you the same basics. Avoid 3.10 and earlier, which no longer receive fixes, and 3.16, which is a pre-release.

If you already have Python, check the full version number. Python 3.15.2 and 3.14.10, released in late October 2026, block compromised keys from a certificate authority, eMudhra, that earlier releases could still trust. Update if yours is lower. If you installed 3.13 or older from python.org, move to 3.15, because the matching fixes for those versions came out as source code only.

Windows 10 and Windows 11

  1. Go to python.org/downloads and download the Python install manager, or install it from the Microsoft Store. Either one works, so pick one.

  2. If you used python.org, double-click the downloaded file and select Install.

  3. Open Terminal or Command Prompt and install the current version:

    py install 3.15
    
  4. Check that it worked:

    python --version
    

You should see Python 3.15 followed by one more number, 2 or higher. To pick up later bug-fix releases, run py install --update. If the installer offers to add a folder to your PATH, that's optional. The older full installer (the .exe) is still offered for 3.15, but it's deprecated and won't be made for Python 3.16.

If python isn't found or opens the Microsoft Store, click Start, open Manage app execution aliases, and make sure the Python (default) entries are on. If they already are, turn them off and on again.

If you see an older version, open Installed apps from Start and look for an old Python. Modify it to turn off its PATH option, or remove it if nothing else on your computer needs it. If py says it can't open a file, the outdated Python launcher is getting in the way. Uninstall that.

macOS

  1. Download the latest installer package from python.org/downloads/macos. It's built for both Apple silicon and Intel Macs, and typically needs macOS 10.15 or later.

  2. Double-click the .pkg file and follow the steps. The standard options suit most people, and you'll need an administrator account.

  3. In Applications > Python 3.15, double-click Install Certificates.command.

  4. Open Terminal and run:

    python3 --version
    

On a Mac, type python3 wherever a tutorial says python. If you're on macOS 27, the latest 3.15 installer matters for another reason: python.org builds from before 21 October 2026 could make IDLE hang when you used some menu commands.

Linux

Python comes preinstalled on most distributions, so run python3 --version first. If it's a supported version (3.11 or later), use it, keep your system updates on and move on. If it's older, work in cs50.dev for now or upgrade your distribution. Don't replace the system's own Python, because Python's documentation warns that a careless install from source can overwrite the python3 command. IDLE is often a separate package: sudo apt install idle on Debian and Ubuntu, sudo dnf install python3-idle on Fedora. On Debian and Ubuntu, also run sudo apt install python3-venv python3-pip, which you'll need in Step 6.

Step 3: Choose an editor and run your first program

Any of these will do, and you can use all of them for free:

  • IDLE is Python's own simple editor. On a Mac it's in Applications > Python 3.15. On Windows, run python -m idlelib in a terminal.
  • Thonny is a beginner IDE with its own Python built in on Windows and Mac (version 5.0.1 bundles Python 3.14). Its debugger walks through a program step by step, and View > Variables shows what each variable holds. If you'd rather skip Step 2 entirely, start here.
  • VS Code with the Python extension (ms-python.python) is the one to grow into. Our best code editor guide compares it with the alternatives.
  • PyCharm is now a single product with a free core, after JetBrains folded in the Community Edition. New installs begin with a 30-day Pro trial, and you can keep the core features for free afterward.

To run your first program in IDLE, choose File > New File, type the two lines below, save the file as hello.py, then choose Run > Run Module (F5).

name = input("What's your name? ")
print(f"Hello, {name}. You just ran a Python program.")

In VS Code, open a folder, create hello.py, and click Run Python File (the play button at the top right). If it uses the wrong Python, open the Command Palette and run Python: Select Interpreter.

You don't need to buy a computer for any of this. Python 3.15 runs on Windows 10 or later and on Macs going back to macOS 10.15. If you're shopping anyway, see our best laptops for programming.

Step 4: Learn the core ideas in this order

CS50P, Python for Everybody and Automate the Boring Stuff shuffle the topics a little, but they cover much the same ground first:

  1. Variables, text and numbers, input() and print()
  2. Conditions with if, elif and else
  3. for and while loops
  4. Functions, including parameters and return
  5. Lists and dictionaries
  6. Errors and exceptions
  7. Reading and writing files
  8. Importing modules and using other people's libraries
  9. Classes and objects

Classes come last for a reason. You can write a lot of useful Python before you need to create one.

Here's what a program looks like once you reach item 6. If you can read every line and predict what happens when someone types 0 or abc, you're ready for your own project.

def split_bill(total, people, tip_percent=20):
    """Return what each person owes, tip included."""
    if people < 1:
        raise ValueError("people must be at least 1")
    with_tip = total * (1 + tip_percent / 100)
    return round(with_tip / people, 2)


try:
    total = float(input("Bill total: "))
    people = int(input("How many people? "))
    print(f"Each person pays ${split_bill(total, people):.2f}")
except ValueError as error:
    print(f"That didn't work: {error}")

A bill of 90 split three ways prints Each person pays $36.00. Now change it: ask for the tip percentage, or keep asking until the input is valid. Editing code that works is the easiest way to start writing your own.

Step 5: Follow a 16-week schedule

This is our suggested schedule, not an official one. It assumes five hours a week and follows the topic order above.

Weeks Focus By the end you can build
1 Setup, variables, input and output A greeting or unit converter
2 to 3 Conditions and loops A number-guessing game
4 to 5 Functions, lists, dictionaries A quiz that keeps score
6 to 7 Errors, debugging, files A to-do list saved to a file
8 Modules, packages, virtual environments A script that uses a library
9 to 10 First real project Something that fixes a chore you have
11 to 12 Tests, web services, regular expressions A tool that pulls in live data
13 Classes and objects A cleaner version of an earlier project
14 to 16 Second project in your chosen direction Something you'd show another person

Four or five shorter sessions are easier to keep up than one long one, so put them in your calendar. If you miss a week, carry on from where you stopped. Don't restart.

Step 6: Use virtual environments and packages

Most of Python's usefulness comes from packages other people have written. Install them inside a virtual environment, a private copy of Python's package folder for one project, so that two projects can't break each other.

Open a terminal in your project folder. On Windows, in Command Prompt (not PowerShell, which needs a different activation script):

py -m venv .venv
.venv\Scripts\activate.bat
python -m pip install requests

On macOS or Linux:

python3 -m venv .venv
source .venv/bin/activate
python -m pip install requests

While the environment is active you'll normally see its name at the start of the command line. Type deactivate to leave it. In VS Code, Python: Create Environment in the Command Palette does the same job.

Keep pip current. In any environment you made before late October 2026, and in new ones on Linux, run python -m pip install --upgrade pip once it's active. Versions of pip older than 26.2.2 still trust the compromised keys mentioned in Step 2, and updating Python doesn't update the pip inside an existing environment.

If you'd rather use PowerShell, the activation command is .venv\Scripts\Activate.ps1. If Windows refuses to run it, that's the script execution policy. The simplest way around it is to go back to Command Prompt, which leaves your security settings alone.

Step 7: Choose a direction

Once you've finished a course and one project, pick a lane. Python's own site and the projects' documentation point to these libraries:

  • Automation: Requests and Beautiful Soup (install it as beautifulsoup4) for web pages, plus the second half of Automate the Boring Stuff for spreadsheets, PDFs and email.
  • Data analysis: pandas, with Jupyter notebooks for working step by step.
  • Websites and APIs: Flask if you want something small, Django for a full framework.
  • Machine learning: scikit-learn, which is free, BSD-licensed and built on NumPy, SciPy and matplotlib. Learn pandas first.
  • Desktop apps: Tk, which is included with most Python downloads, or Kivy. Kivy's current release (2.3.2) officially supports Python 3.8 to 3.14, so use Python 3.14 for a Kivy project until that changes.

Choose by the project you want to exist, not by which field sounds impressive.

Should you use AI while learning Python?

Yes, as a tutor. Don't let it write your exercises.

The best evidence we found is a randomized trial Anthropic published in January 2026. It gave 52 mostly junior engineers an unfamiliar Python library, with or without an AI assistant. The AI group averaged 50% on a quiz afterward, against 67% for those who coded by hand, and finished only about two minutes faster, which wasn't statistically significant. People who asked conceptual questions or had code explained to them scored 65% or higher. Those who handed over the coding scored below 40%. The study was small, came from a company that sells an AI assistant, and its participants already knew Python, so treat it as a strong hint for beginners rather than proof.

In practice:

  • Try a problem yourself first, and read the last line of the error message before asking anyone.
  • Ask "why does this fail?" or "explain this line", not "fix this".
  • Use a tutoring mode. In ChatGPT, type @study at the start of a message and select Study. In Gemini on the web, click the Add files icon, then More tools > Guided Learning.
  • Retype and change any code you accept, until you can explain it without the chat open.

Our prompt engineering guide has more on asking good questions, and what vibe coding is covers where letting AI write everything goes wrong.

How long does it take to learn Python?

Expect anywhere from 27 to 135 hours for the basics, going by the courses' own figures:

  • CS50P: nine weeks at 3 to 9 hours, so 27 to 81 hours.
  • Python for Everybody: about 79 hours across five courses on Coursera. Coursera's page says two months at 10 hours a week, while its FAQ says most learners take about eight months.
  • Helsinki's Introduction to Programming: 5 credits. The university counts about 27 hours per credit, so roughly 135 hours.

That gets you to writing useful small programs on your own. Being ready for a programming job takes longer, and how much longer depends on the job.

What should you do when you get stuck?

You understand the videos but can't write anything. Close the video and rebuild the example from memory. Then change one thing about it.

The error message makes no sense. Start with the last line, which names the error, then find the line number above it. Look for a missing colon, bracket or quote mark, and check your indentation.

ModuleNotFoundError after you installed the package. You probably installed it into a different Python. Activate the project's virtual environment, then install with python -m pip install again. In VS Code, also check Python: Select Interpreter.

You keep switching courses. Go back to the first one. The opening weeks of every course feel productive because you already know them.

Once you have a project worth keeping, learn how Git and GitHub differ and put it under version control.

Frequently asked questions

Can I learn Python for free?

Yes. Python itself, IDLE, Thonny and VS Code are free, and so are CS50P, Python for Everybody on py4e.com, freeCodeCamp's Python Certification and the online edition of Automate the Boring Stuff with Python. CS50P and freeCodeCamp also offer free certificates.

Which Python version should a beginner install?

The newest 3.15 release on python.org, which means 3.15.2 or later. Versions from 3.11 up still get at least security fixes, but skip 3.16 because it's a pre-release.

Is Python hard to learn with no experience?

The first steps are manageable: CS50P and Automate the Boring Stuff are both designed to work for people who have never programmed. The harder part is moving from following lessons to writing your own programs, which is why this plan starts projects early.

Can I learn Python on my own?

Yes. The courses in this guide are built for self-study. CS50P gives feedback on the problem sets you submit, Python for Everybody has autograded assignments, and Exercism adds free feedback from volunteer mentors.

Is it still worth learning Python now that AI writes code?

We think so, because you need to understand code to judge and fix what an AI produces. In Anthropic's 2026 trial, the biggest gap between people who used AI and people who didn't was on debugging questions.

Sources

Was this helpful?

Keep reading

Two screens of code side by side behind a keyboard, for a comparison of Cursor vs Copilot
AI Coding Tools
AI & Dev Tools

Cursor vs Copilot: Grok Build (formerly Cursor) or GitHub Copilot?

Cursor vs Copilot in December 2026: what each plan costs, why the same Claude tokens cost you more in Cursor, what the Grok Build rename changes and which one to pick.

17 min read

GitHub's Octocat figurine in front of a monitor, for a guide to GitHub Copilot plans
AI Coding Tools
AI & Dev Tools

GitHub Copilot plans explained: Free, Pro, Pro+, Max, Business and Enterprise prices and AI credits

Every GitHub Copilot plan in December 2026, from Free and Student to Pro, Pro+, Max, Business and Enterprise: prices, AI credits, models and what happened to premium requests.

19 min read

Man on a video call at his desk with a notebook beside the laptop, where the best AI meeting assistant takes the notes
Best AI Tools
AI & Dev Tools

Best AI meeting assistant in 2026: Fathom, Granola, Otter, Fireflies and the built-in options compared

The best AI meeting assistants in December 2026: Fathom, Granola, Otter, Fireflies and the AI in Zoom, Teams and Meet compared on price, free limits, bots and consent.

24 min read