PromptPreview
Chapter 4Exercises

Separating Data and Instructions

3 exercises

4.1
Haiku Topic
template
Write a prompt in the highlighted template box that will take in a variable called "{{TOPIC}}" and output a haiku about the topic. This exercise is just meant to test your understanding of the variable templating structure.
{{TOPIC}}
LLM Response

Submit your prompt to see the response here.

4.2
Dog Question with Typos
template
Fix the prompt in the highlighted template box by adding XML tags so that Claude produces the right answer. Try not to change anything else about the prompt. The messy and mistake-ridden writing is intentional, so you can see how Claude reacts to such mistakes. Claude's response will turn GREEN if your prompt produces the right answer. Note: Although Claude can somewhat parse through broken prompts with poor grammar and misspelled words, having a clearly written, spell-checked and grammatically correct prompt far decreases the risk of Claude making mistakes and far increases the quality of Claude's output.
{{QUESTION}}
LLM Response

Submit your prompt to see the response here.

4.3
Dog Question Part 2
template
Fix the prompt in the highlighted template box WITHOUT adding XML tags. Instead, remove only one or two words from the prompt. Just as with the above exercises, try not to change anything else about the prompt. This will show you what kind of language Claude can parse and understand. Claude's response will turn GREEN if your prompt produces the right answer.
{{QUESTION}}
LLM Response

Submit your prompt to see the response here.