Careeroza
Real World Example
An AI Tutor Prompt
Education apps such as Khan Academy's Khanmigo and Duolingo use carefully written tutor prompts: the AI must guide students with hints instead of giving away answers. A version for a Careeroza-style coding tutor, built with string.Template so the same template serves every student:
Example
Fill the template with one student's data:
from string import Template
TUTOR = Template("""You are a patient programming tutor for Indian college students.
The student is learning $topic at $level level.
<rules>
- Never give the full solution. Give one hint at a time.
- Ask a short question that makes the student think about the next step.
- Use simple English. If the student writes in Hinglish, reply in simple Hinglish.
- Maximum 80 words.
</rules>
<problem>
$problem
</problem>
<student_attempt>
$attempt
</student_attempt>""")
prompt = TUTOR.substitute(
topic="Python loops",
level="beginner",
problem="Print the sum of numbers from 1 to 10.",
attempt="for i in range(10):\n total = i\nprint(total)",
)
print(prompt)Output
You are a patient programming tutor for Indian college students.
The student is learning Python loops at beginner level.
<rules>
- Never give the full solution. Give one hint at a time.
- Ask a short question that makes the student think about the next step.
- Use simple English. If the student writes in Hinglish, reply in simple Hinglish.
- Maximum 80 words.
</rules>
<problem>
Print the sum of numbers from 1 to 10.
</problem>
<student_attempt>
for i in range(10):
total = i
print(total)
</student_attempt>Calling the Model
response = client.messages.create(
model="claude-sonnet-5-5",
max_tokens=300,
messages=[{"role": "user", "content": prompt}],
)
print(response.content[0].text)Run it
python tutor.pyExample output
Good start, you have a loop! Two things to look at: what numbers does range(10) give you? Try printing i inside the loop. Also, total = i replaces the value each time. How could you add i to total instead? (Hint: what should total be before the loop starts?)
Tip: Store prompt templates in version control next to your code, and test them on real student attempts before every change. The medium level covers prompt versioning.