Task
📝 **Question:** **Write the function** \`cos_sim(a, b)\` — cosine similarity between two equal-length vectors of floats, no numpy. Round the result to 3 decimals.
Formula:
\`\`\`
dot(a, b) / (norm(a) * norm(b))
\`\`\`
where \`dot\` is the sum of paired products and \`norm\` is sqrt of sum of squares.
Then compare a real query against three documents:
\`\`\`
query = [0.21, -0.04, 0.87, 0.14] # "How do I cancel my subscription?"
refund = [0.19, -0.05, 0.85, 0.16] # "refund my plan please" — should be CLOSE
weather = [0.92, 0.41, 0.02, 0.78] # "what is the capital of France?" — far
unrelated = [0.00, 1.00, 0.00, 0.00] # orthogonal — exactly 0 with query? no, very small
\`\`\`
Print three lines:
\`\`\`
refund: 0.999
weather: 0.263
unrelated: -0.044
\`\`\`
📋 Pick the right answer.
💡 **Hint:** Re-read the theory above if unsure.