Advanced AI · Lesson 9 of 10

A first taste of code

Build a small working tool with AI, without knowing how to program.

AI tools can write computer code from a plain description. That means you can now make small tools for yourself: a calculator for your pricing, a tip splitter, a countdown page, a simple quiz. Many chatbots can also run and show what they build inside the chat, so you see it working at once.

Start very small. One screen, one job. "A page where I enter the cost price and my margin, and it shows the selling price." Small tools succeed. Big ideas described in one prompt fail.

Describe it like a product. Who uses it, what they enter, what they see, and one example with real numbers and the result you expect.

Build in steps. Get the simplest version working. Then add one feature at a time: "Add a button to copy the result." "Make it work well on a phone." If something breaks, say exactly what you did and what happened, and paste any error message.

Test it yourself. Try normal values, zero, a blank box, a very large number, and letters where numbers belong. Compare the results with a calculator. AI-written code often works for the obvious case and fails at the edges.

Ask it to explain. "Explain what each part of this code does, in plain language." You will learn quickly, and you will spot nonsense sooner.

Know the limits. Test a small personal tool with made-up data before relying on it. Anything that handles other people's personal data, payments, logins or passwords needs a real developer to review it. AI-written code can contain security holes that a beginner cannot see.

Spreadsheets count. A formula or a small script for a spreadsheet is code too, and often the most useful kind.

Example

Build me a simple web page tool. Purpose: work out a selling price. I enter: cost price, and the profit margin I want as a percentage. It shows: the selling price and the profit in money. Example: cost 80 and margin 20% should give a selling price of 100 and a profit of 20. Make it clear and usable on a phone. Handle blank or non-number input with a friendly message. Then explain in plain language how it works.

Your task

Think of a small calculation or check you do often. Describe it using the pattern above and have an AI build it. Test it with five inputs, including a blank and a silly one. Ask for one improvement. Then ask the AI to explain the code.

Quick check

1. What is the best size for a first tool?
Check answer 1

One screen that does one job

2. Why test with blank, zero and odd inputs?
Check answer 2

AI-written code often fails at the edges

3. Which tool needs a real developer to review it?
Check answer 3

Anything handling other people's data, payments or passwords

Optional browser progress

Your progress

0 of 10 available lessons completed

0 of 10

Progress stores only the course identifier and completed lesson identifiers in this browser. It does not save your answers, prompt text or identity, and it does not sync to another device. Clearing browser data removes it.

Practise on paper with the workbook