Educator’s Choice
You answeredJUST NOW
Python
STDIN
[1, 2, 3]
[-1, -2, -3]
[-1, -2, -3]
Expected STDOUT
-1.000
Your STDOUT
-1.000
STDIN
[1, 2, 3]
[1, 2, 3]
[1, 2, 3]
Expected STDOUT
1.000
Your STDOUT
1.000
STDIN
[0, 2, 0]
[1, 0, 3]
[1, 0, 3]
Expected STDOUT
0.000
Your STDOUT
0.000
STDIN
[33, 15, -20]
[22, 7, -13]
[22, 7, -13]
Expected STDOUT
0.995
Your STDOUT
0.995
STDIN
[36.2, -37.8]
[-67.3, -64.2]
[-67.3, -64.2]
Expected STDOUT
-0.002
Your STDOUT
-0.002
STDIN
[67, -43, 33, -96, 36]
[-3, -37, 42, 13, 11]
[-3, -37, 42, 13, 11]
Expected STDOUT
0.245
Your STDOUT
0.245
Instructor solution
Cosine similarity formula
By Alec Kretch (Apr 12, 2024)
Cosine similarity example clip
You may exit out of this review and return later without penalty.