To learn Python from scratch, install Python 3 and a code editor, then work through the core concepts in order (variables, conditions, loops, functions, lists and dictionaries, files, classes) while writing small programs every day. A realistic plan for a complete beginner is about 12 weeks at an hour or more on most days, ending with two or three projects you built yourself.

Why learn Python first?

Python reads almost like English, has a huge standard library, and is the main language for data science, machine learning and AI. It is also widely used for automation, web backends and scripting. That makes it the best first language for anyone heading towards data science or AI.

LanguageBest forBeginner-friendliness
PythonAI, data, automation, backendsVery high
JavaScriptWebsites, web apps, Node.js backendsHigh
JavaEnterprise systems, AndroidMedium
C / C++Systems, performance, competitive programmingLower

Unsure between Python and JavaScript? Read JavaScript vs Python: which to learn first.

What do you need to set up?

  • Python 3 from python.org (tick "Add Python to PATH" on Windows).
  • A code editor: VS Code is free and works on every operating system.
  • The terminal: learn to run python file.py and move between folders. It feels strange for a week, then becomes natural.
  • Git and a GitHub account to save and show your work.

What is a 12-week plan to learn Python?

WeeksTopicsPractice
1Setup, print, variables, numbers, strings, inputA tip calculator; a unit converter
2Conditions and boolean logicGrade calculator; leap-year checker
3Loops: for, while, range, break/continueMultiplication tables; number-guessing game
4Functions, parameters, return values, scopeRewrite earlier programs as functions
5Lists and tuples; slicing; list comprehensionsMarks analyser: average, highest, lowest
6Dictionaries and setsWord-frequency counter; phone book
7Files, errors and exceptionsExpense tracker that saves to a CSV file
8Modules, pip, virtual environmentsUse a third-party library (requests or rich)
9Classes and objects (OOP)Bank account and library-system classes
10Recursion, iterators, generatorsFactorial, Fibonacci, directory walker
11APIs and JSON; testing with pytestWeather or currency app using a public API
12Project weekBuild and publish one project of your own

Need project ideas? See Python projects for beginners.

How much time should you practise?

Weeks to finish the 12-week plan at different daily practice times
2 hours a day≈7
1 hour a day12
30 minutes a day≈24

Simple arithmetic on the plan above (about 84 hours of practice). Consistency matters more than speed.

Short daily sessions beat long weekend sessions. Programming is a skill like a language or an instrument: the daily habit is what makes it stick.

What mistakes slow beginners down?

  • Watching without typing. Pause every video and write the code yourself, then change it.
  • Copying solutions too early. Struggle for 20 minutes before looking. The struggle is where learning happens.
  • Tutorial hopping. Pick one structured path and finish it.
  • Ignoring error messages. Read the last line of a traceback first; it usually tells you exactly what went wrong.
  • Skipping projects. Small programs you designed yourself teach more than ten finished exercises.

How do you know you've learned Python?

You are ready to move on when you can, without looking things up constantly:

  1. Open a blank file and write a program that reads a CSV, processes it and writes results.
  2. Break a problem into functions and explain why you split it that way.
  3. Use lists, dictionaries and classes appropriately.
  4. Read an error message and fix the bug yourself.
  5. Install a library and follow its documentation.

What does good beginner Python code look like?

Beginners often focus on getting code to run. The next step is writing code that someone else, including you in three months, can read. A few habits make a big difference early:

  • Meaningful names: monthly_total instead of x; is_valid_phone() instead of check().
  • Small functions that do one thing. If you can't name a function clearly, it is probably doing too much.
  • No repeated code: when you copy and paste a block for the third time, turn it into a function.
  • Follow PEP 8, Python's style guide: four-space indentation, lowercase function names, spaces around operators. Editors like VS Code can format this automatically.
  • Comments that explain why, not what. The code shows what it does; comments should explain decisions that aren't obvious.

How do you get unstuck when learning alone?

Everyone gets stuck. The difference between people who learn to code and people who give up is mostly how they handle being stuck. A reliable routine:

  1. Read the full error message, especially the last line and the line number it points to.
  2. Print things. Add print() statements to see what your variables actually contain at each step. Most bugs are a variable holding something you didn't expect.
  3. Shrink the problem. Copy the failing part into a new file and remove everything else until the bug is obvious.
  4. Explain it out loud (or to a rubber duck). Describing what each line should do often reveals the mistake.
  5. Search the exact error message, then read the official documentation for the function involved.
  6. Ask with context: what you tried, what you expected and the exact error. AI assistants help here too, but ask them to explain, not just to fix.

A mentor or a doubt session shortens this loop dramatically. A problem that costs a beginner two evenings often takes a mentor two minutes to spot, and those saved evenings add up over months.

Should you use AI coding assistants while learning?

Yes, carefully. Tools that write code are part of every developer's workflow now, and learning to use them well is a skill. The trap is letting them think for you before you've built the fundamentals. A sensible rule for your first months: write it yourself first, then ask an assistant to review your code or explain an alternative. Use it as a tutor, not a ghostwriter. Interviews, debugging sessions and real projects all expose the difference quickly.

Which free resources are worth using?

The official Python tutorial on python.org is clear and accurate, and the standard-library documentation is the best reference once you know the basics. Practice sites with small exercises help build fluency with loops and data structures. Reading other people's well-written code on GitHub teaches style and structure. Whatever you use, pair every resource with your own projects; passive reading alone rarely turns into the ability to write programs from a blank file.

Finally, keep a learning log: a simple file where you note each day what you learned and what confused you. Reviewing it weekly shows you exactly which topics need another pass, and it becomes a record of real progress on days when learning feels slow.

What should you learn after Python?

That depends on your goal. For AI and data science: data structures and algorithms, SQL, then Pandas, NumPy and statistics, then machine learning. For web development: JavaScript, HTML and CSS, then a framework. Our earlier post on Python for AI and data science covers the libraries that matter.

Program Zero teaches Python live in its first phases, alongside JavaScript, with weekly assignments reviewed by mentors and a Sunday doubt session for when you are stuck. See the Python course page for the full topic list.