LLM Engineering · Exercise 1 of 6Next
Intermediate
Write two scorers
Write exact_match(want, got): True when the two strings are equal after removing spaces at both ends and ignoring upper and lower case, otherwise False.
Write contains_all(words, got): True when every word in the list appears in got, ignoring case. An empty list gives True.
What Check tests
- exact_match ignores case and surrounding spaces
- exact_match rejects extra characters
- contains_all finds every word, ignoring case
- contains_all fails when one word is missing
- an empty word list passes
Stuck? One hint at a time
The solution unlocks after your first Check. Try first: that is where the learning happens.
main.py
Sign in to run your code.
Output
Press Run to see what your program prints.