🎙 Free live masterclass · Sun, 29 Nov, 7:00 pm IST · Java Full Stack roadmap Register free →
Skills101
← 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])))
  1. A.casual
  2. B.steady
  3. C.crammer
  4. 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 →