Easier to read with cream paper, a tint, more contrast or larger text? Choose your colours and text, once, for every page.

Preview

Design the solution and use AI wisely

This is the first page of the lesson. Read it and have a go at the activities. The rest is in the full lesson.

45 minutes

A helper that can be wrong

Imagine a helper who writes code very fast. They never get tired. But sometimes they sound sure and they are wrong.

That is generative AI. It can write a short piece of code for you. You must still check it. You are the developer. The helper is only a tool.

Key words

WordWhat it meansExample
Generative AIA tool that writes text or code when you give it a prompt.a chat assistant
PromptThe words you give the AI to say what you want.Write a Python function that ...
SnippetA short piece of code for one job.one function
ReviewChecking something carefully and deciding if it is good.run it and read it
DesignA plan of how the solution will work, made before building.screens and steps
AlgorithmA list of steps that solves a problem.steps to join a waiting list
FlowchartA diagram of steps with arrows.start, check, book
LibraryExtra code that other people wrote, which you can use.pandas
FunctionA named piece of code that does one job.next_in_line()
InterfaceWhat the user sees and uses.a form

The cells students fill in are left blank in this preview.

What a design pack holds

PartWhat it showsHillside example
Interface designThe screens the user will seeA "Join the waiting list" button and a list
Algorithm designThe steps for the key problemsA flowchart for moving the first person up when a booking is cancelled
Data designWhat is stored, and in what formA waiting list file with member, court, hour

The cells students fill in are left blank in this preview.

Which part of the design does the job?

Have a go

Which part of the design does the job?

6 questions
Have a go: your answers are marked here and then forgotten. Sign in if you would like your score kept, and to pick up where you left off.Sign in to keep your score

Your answers are marked here and are not kept. A college account keeps every student’s marks.

A good prompt is a clear brief

A weak prompt gets a weak answer. Say clearly what you want:

  1. The language and version.
  2. The job of one function.
  3. What goes in and what comes out.
  4. An example.
  5. Limits, such as "use no libraries".

Ask for one small function. Do not ask the AI to build the whole tool.

A weak prompt and a strong prompt

WeakStrong
Make a waiting listWrite a Python 3.10 function join_waiting_list(waiting, member, court, hour). waiting is a list of dictionaries. Add the member and return their place for that court and hour. Return 0 if they are already waiting. Use no libraries.
Fix my codeThis function should return 0 for a repeat member. It returns 2. Here is the code and the test. What is wrong?

The cells students fill in are left blank in this preview.

Quick check: prompts and checks

Have a go

Quick check: prompts and checks

5 questions
Have a go: your answers are marked here and then forgotten. Sign in if you would like your score kept, and to pick up where you left off.Sign in to keep your score

Your answers are marked here and are not kept. A college account keeps every student’s marks.

The lesson goes on

5 more parts of this lesson are in the full curriculum, with the tasks, the final check and the labs. A college account gives your students all of it.