Python for Beginners
Welcome
You have never written a program, and every course, job posting and tutorial seems to assume you have. This course starts at the blank file. You will install Python, type your first line, and build up, chapter by chapter, to a script that reads your files, remembers its data, talks to the internet, survives its own mistakes and comes with tests that prove it works.
What You Will Learn
Once a month you add up your bank statement: what went on food, on transport, on bills. It takes an evening, one missed row spoils a total, and next month you start again. A program could do it in a moment, and this course builds that program.
When you finish, you will be able to:
- Install Python, write a program in a plain text file, run it from the terminal, and read its errors from the bottom line up.
- Make a program ask a question, choose between cases, repeat work over a list, and split the job into small named functions.
- Read the statement your bank exports, total spending by category, keep money exact to the cent, and add to a file without erasing it.
- Handle a bad row without crashing or hiding it, and track down a wrong answer by changing one thing at a time.
- Use code other people wrote: the tools that come with Python, and add-on packages, each checked for a lookalike name before you install it.
- Fetch today's exchange rate from a web service, fall back to the saved rate when the network fails, and keep passwords and access keys out of the code.
- Turn your script into a command you can give settings to, test it automatically, and read a complete program of about a hundred and fifty lines.
You leave understanding what your code does line by line, and what its errors mean. You know the words Python programmers use, with every term drilled in the flashcards. You know where Python leads next: keeping your code's history, the services behind websites, and data and machine learning. Pass every quiz and know every flashcard, and you earn a certificate with a public link.
About This Course
Python is the language this catalogue keeps pointing at. Machine learning is built on it, many backend services are written in it, and it is the tool people reach for when a task on a computer is dull enough to automate. This course teaches it from zero, to the point where you can write a useful program of a couple of hundred lines, maintain it, and read other people's Python without flinching.
It is a hands-on book. Every idea is explained in plain words first, and every program in it is one you type and run yourself. You will see a great many error messages along the way, on purpose, because learning to read them calmly is most of what separates a stuck beginner from a working programmer.
Who This Is For
Anyone who has never programmed and wants to start properly: career-switchers, students, analysts who are tired of doing the same spreadsheet by hand, testers and support engineers who keep meeting scripts, and readers of this catalogue's beginner books who reached the words "Python first" and wondered where to begin. If you can install an app and find a file in a folder, you have the background this course needs.
It is not a course about any one field. It does not teach web frameworks, databases or data-science libraries; those are the next books, and the last chapter points to them. It teaches the language itself, well enough that the next book reads easily.
What You Should Already Know
- How to use a computer, a browser and everyday apps, at an ordinary user's level
- How to find, create and rename files and folders in your file manager
- No programming, and no command-line experience: the terminal is introduced from zero in Chapter 1
- Arithmetic you already use for shopping and bills; no mathematics beyond that
How the Course Is Built
Twelve chapters in six movements. First contact (Chapters 1 and 2): what a program is, the terminal, installing Python, values and names. Control (Chapters 3 to 5): making decisions, repeating work with loops, and naming pieces of work as functions. Data (Chapters 6 and 7): dictionaries and their relatives, and reading and writing files. Failing well, and structure (Chapters 8 and 9): handling errors, splitting a program into modules, the standard library, and installing packages. The outside world (Chapter 10): saving data as JSON, requesting information from the internet, settings, and command-line arguments. Growing up (Chapters 11 and 12): classes, automated tests, the tools professionals use, and where to go next.
Every topic has the same shape: the problem it solves, the idea built step by step with code you can run, the mistakes people really make, why it matters, and a short knowledge check. Where a real example helps, it is a familiar one: your own spending, a bank statement, a trip abroad. Everything else uses the smallest example that makes the point.
Chapter Map
Disclaimer
This course is an independent educational project created and maintained by Sergey Okinchuk. It is provided for learning and reference purposes only.
No affiliation. This course is not affiliated with, sponsored by, endorsed by, or officially connected to the Python Software Foundation or any other company, product, or organization. "Python" is a registered trademark of the Python Software Foundation.
Trademarks. Product and company names referenced are the property of their respective owners. Use of any name is for identification and educational purposes only and does not imply endorsement.
Educational simplifications. This material teaches durable concepts for understanding. Explanations are deliberately simplified for learning; where a simplification could mislead, the text flags it. This course is not professional, legal, or financial advice, and its spending examples are examples, not budgeting advice.
Accuracy and currency. Tools, installers and services change over time. Facts reflect the author's understanding at the time of writing, against Python 3.15. Always consult the official documentation at python.org for the current state of any tool.
No warranty. This material is provided "as is" without warranty of any kind. The author accepts no liability for any loss or damage arising from reliance on the content.