Cosine similarity asks a single question about two vectors: do they point the same way? It ignores length entirely, which is why it's the default distance measure for embeddings — a long document and a short one about the same subject should still count as similar.
cos(a, b) = (a · b) / (‖a‖ · ‖b‖)
The result runs from 1 (identical direction) through 0 (perpendicular) to -1 (opposite).
Task: write cosine_similarity(a, b) for two equal-length lists, returning a float rounded to 4 decimal places.
0.0 rather than dividing by zero.