Build a script with AI
Direct a model to write a small Python program — and review the input handling it skips.
A temperature converter produced under your direction.
What a function plus input handling should look like, the prompt, and the review pass.
Prerequisites
A coding assistant. Python installed to run it, or read along.
What a small program should look like
- A function does ONE thing and returns a value — easy to read, easy to test.
- Input from the outside world is untrusted: a model rarely guards against a non-number unless told.
- Output is for a human: label it, do not just print a bare float.
The prompt
Write a Celsius-to-Fahrenheit converter in Python. Constraints:- A pure function celsius_to_fahrenheit(c: float) -> float with a docstring.- A small loop that asks the user for a value and prints a labelled result.- Reject non-numeric input with a clear message instead of crashing.- No external libraries. Output a single converter.py.Review what it writes
Review rubric
Tutorial
Learn the basics directly
The Learn tab writes the program by hand. Come here to direct it.
Concepts covered · 1
More like this
Make a page respond: a click counter
A page becomes alive the moment JavaScript listens for an event and changes the page in response. Build a counter, then open it in /code.
Build interaction with AI
The vibe-coder path for JS events: the event→state→render loop you must hold in your head, the prompt, and the review.
Build a program with AI
The vibe-coder path for C++: the few things you must understand to judge AI-written C++, the prompt, and the review.
Liked this one?
Pass it on
Discussion
Be the first to ask
Your questions stay private with the team. We can pin answers to share with everyone.
Sign in to ask a question privately on this tutorial.
Sign inNo pinned answers yet for this tutorial.