Beginner
Retrieve the top k above a minimum score
HANDBOOK is a list of (doc_id, text) pairs and score(question, text) is given.
Write retrieve(question, k, min_score) that returns a list of (doc_id, score) pairs: only passages with score >= min_score, best first, ties kept in handbook order, at most k of them.
What Check tests
- The monthly pass question finds D8 then D10
- Ties keep handbook order
- At most k results
- Nothing above the bar gives an empty list
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.