← Quiz: Embeddings and Search: all 10 questions
Quiz: Embeddings and Search · Question 6 of 10
What does this print? (code)
What does this print?
import math
a, b = [1, 0], [0, 1]
dot = sum(x * y for x, y in zip(a, b))
cos = dot / (math.hypot(*a) * math.hypot(*b))
print(cos)
- A.0.0
- B.1.0
- C.-1.0
- D.0.5
Answer & explanation
Correct answer: 0.0
The vectors are at right angles, so they are unrelated: cosine similarity 0.
Can you get the rest right without peeking?
Take the timed Quiz: Embeddings and Search quiz free. Pass it to earn XP and count towards your certificate.
Start the quiz →