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
Your first Python program
Python reads almost like English. Write a small converter, see its output, and open the project in /code to keep editing.
Build a program with AI
The vibe-coder path for Go: the idioms you must recognise, the prompt, and the review that catches dropped errors.
Your first C++ program
C++ trades a little ceremony for a lot of speed and control. Write a first program, learn the compile-then-run cycle, and open it in /code.
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.