← Quiz: Clustering and PCA: all 10 questions
Quiz: Clustering and PCA · Question 7 of 10
What does this print? (code)
What does this print?
import math
centres = {"casual": (2, 1), "steady": (6, 4), "crammer": (12, 2)}
learner = (10, 3)
print(min(centres, key=lambda c: math.dist(learner, centres[c])))
- A.casual
- B.steady
- C.crammer
- D.(12, 2)
Answer & explanation
Correct answer: crammer
The learner is about 2.2 away from the crammer centre and about 4.1 from the steady centre.
Can you get the rest right without peeking?
Take the timed Quiz: Clustering and PCA quiz free. Pass it to earn XP and count towards your certificate.
Start the quiz →