Technology & Software · Written by the Blessed Records editorial team · Published 21 October 2026

Python is often recommended as a first programming language because its code reads almost like plain English. It is used for automation, data analysis, web development and artificial intelligence. In this tutorial you will install Python, run a short script and learn four basic ideas: variables, lists, loops and functions.

Setting up

  1. Download Python from python.org and install it. On Windows, tick the option to add Python to the path.
  2. Open a plain text editor or a beginner-friendly editor such as Visual Studio Code.
  3. Create a file named hello.py.
  4. Open a terminal in the same folder and run it with python hello.py (or python3 hello.py on some systems).

Your first script

Paste this into hello.py and run it.

def tip(bill, percent):
    return bill * percent / 100

names = ["Ada", "Tunde", "Ngozi"]
for name in names:
    print("Hello,", name)

total = tip(8000, 10)
print("Tip:", total)

What each part does

  • Function: def tip(bill, percent): defines a reusable block of code that accepts inputs and returns a result.
  • List: names = [...] stores several values under one name.
  • Loop: for name in names: repeats the indented code once for each item.
  • print: shows output on the screen.
  • Indentation: Python uses spaces at the start of a line to show which code belongs together, so spacing matters.

Useful things you can build next

  • A script that renames a folder full of files in a consistent pattern.
  • A budget calculator that asks for your income and expenses.
  • A program that reads a spreadsheet and summarises it.
  • A small quiz game.

Common errors

  • IndentationError: lines are not lined up correctly.
  • NameError: you used a name that has not been defined, often because of a typo.
  • SyntaxError: something is missing, such as a colon or a closing bracket.
  • Mixed quotes: make sure every string starts and ends with the same type of quotation mark.

How to keep learning

Write a little code every day, even for fifteen minutes. Rebuild small tools that solve a real problem in your own life, because a project you care about is easier to finish. When you get stuck, read the error message from the bottom up, search for the exact wording and try again before asking for help.

Common questions

Which version of Python should I install?
Install the latest stable version of Python 3. Python 2 is obsolete and no longer supported.

Do I need to be good at maths?
Not for most beginner projects. Logical thinking and patience matter more.

How long until I can build something useful?
Many beginners write small helpful scripts within a few weeks of regular practice.

A mini project to try

Write a script that stores a list of your monthly expenses, adds them up and prints the total. Then extend it to show the largest expense and the average. Working on a small tool that you can actually use keeps you motivated and teaches loops, lists and functions in a practical way.

Key takeaways

  • Python reads clearly and suits beginners.
  • Variables, lists, loops and functions cover most first scripts.
  • Practise on small real projects and read error messages carefully.

Keep reading

This article is for general information and education. It is not legal, financial or professional advice. Read our editorial standards.

    Share