Python is one of the friendliest first programming languages. Its code reads almost like plain English, it runs on any ordinary laptop and it is used for everything from automating office tasks to analysing data and building websites. If you have never written a line of code, this guide shows you how to start, what to learn first and how to avoid the mistakes that make many beginners give up.
Why Python is a good first language
Python lets you focus on solving problems instead of fighting complicated syntax. A beginner can write a useful script in a few lines, and the same language keeps growing with you. Data analysts use it to clean and summarise information, developers build web applications with it and administrators use it to automate repetitive work. That range means the time you invest is rarely wasted, whichever direction your career takes.
What you need to get started
You do not need an expensive computer. Any laptop that runs a modern web browser comfortably can run Python. You need:
- A laptop or desktop computer. A phone is fine for reading lessons, but writing code is much easier with a keyboard and a bigger screen.
- Python itself, downloaded free from python.org. Choose the latest stable version for your operating system.
- A code editor. Thonny is very simple and made for beginners; Visual Studio Code is free and widely used at work.
- A few hours a week, spread over several sessions.
If your laptop is old or you cannot install software, Google Colab lets you write and run Python inside a web browser. It is a good way to begin, though you should install Python locally once you can, because that is how real projects work.
Set up and write your first program
After installing Python, open your editor, create a file called hello.py and type:
name = input("What is your name? ")
print("Habari, " + name + "! Welcome to Python.")
Run it, type your name and press Enter. You have just used a variable, read input from the user and printed output. Those three ideas appear in almost every program you will ever write.
Learn the core ideas in this order
Beginners often jump between topics and end up confused. Follow a steady order and practise each idea before moving on:
- Variables and data types: numbers, text (strings) and true or false values (booleans).
- Operators and expressions: arithmetic, comparisons and combining conditions.
- Decisions with
if,elifandelse. - Loops with
forandwhile, to repeat work. - Lists and dictionaries, to store collections of data.
- Functions, to package code you can reuse.
- Reading and writing files, including CSV files.
- Handling errors with
tryandexcept. - Modules and packages, to use code other people have written.
If the idea of thinking like a programmer is completely new to you, Introduction to Programming and Computational Thinking teaches how to break problems into steps before you worry about syntax. If you are ready to work through the language itself in a structured way, Python Programming from Zero to Job-Ready follows this order with an exercise after every lesson and a final project.
Build small projects early
Reading about code is not the same as writing it. As soon as you know variables, decisions and loops, start building small programs that solve problems you recognise. A few ideas:
- A chama contributions tracker that stores each member's monthly payments in a dictionary and prints who is up to date.
- A simple budget calculator that asks for your income and expenses and shows what is left.
- A statement summariser that reads a CSV export of your own transactions and totals spending by category.
- A quiz game that asks questions from a list and keeps score.
- A file renamer that tidies the names of photos or documents in a folder.
Here is the start of the contributions tracker:
contributions = {"Achieng": 2000, "Kamau": 1500, "Wanjiru": 2000}
target = 2000
for member, paid in contributions.items():
if paid >= target:
print(member, "is up to date")
else:
print(member, "owes", target - paid)
Change the names and amounts, add a member, or ask the user to type in new payments. Every small change teaches you something.
Make mistakes on purpose
Error messages scare many beginners, but they are your most helpful teacher. When something breaks, read the last line of the error first: it names the type of problem and the line number. Common early errors include NameError (you misspelled a variable), IndentationError (your spaces are inconsistent) and TypeError (you tried to join text and a number without converting).
Try breaking your working programs deliberately to see what each error looks like. You will recognise them quickly when they appear for real.
A realistic first month
| Week | Learn | Build |
|---|---|---|
| 1 | Install Python, variables, input and output, if statements | A greeting program and a simple calculator |
| 2 | Loops, lists and dictionaries | The chama tracker and a quiz game |
| 3 | Functions and files | Save the tracker data to a file and load it again |
| 4 | Errors, modules and CSV files | A statement or budget summariser |
Three or four sessions of 45 to 60 minutes each week is enough to follow this plan. Consistency matters much more than long weekend marathons.
Common beginner mistakes
- Watching or reading for weeks without typing code yourself.
- Copying code without understanding it. Retype examples and change them.
- Trying to learn several languages at once. Stay with Python until the basics feel natural.
- Giving up when stuck. Take a break, explain the problem out loud in plain words, and break it into smaller steps.
- Skipping version control. Learning the basics of Git and GitHub early lets you save your progress and share projects with employers.
Where to go next
Once the basics are comfortable, choose a direction that matches your goals:
- Office automation: Python for Automation shows how to work with Excel files, PDFs, emails and folders, which can save hours of repetitive work every week.
- Data analysis: Data Analysis with Python and Pandas teaches you to clean, analyse and chart data with the pandas library.
- Web development: frameworks such as Django and Flask let you build web applications with the Python you already know.
Whichever path you choose, keep building. A handful of small, working projects on GitHub, together with a certificate of completion that names your course, tells an employer far more than a list of topics you have read about.

