🎙 Free live masterclass · Sun, 29 Nov, 7:00 pm IST · Java Full Stack roadmap Register free →
Skills101
← Quiz: Load Testing and Capacity Planning: all 10 questions

Quiz: Load Testing and Capacity Planning · Question 8 of 10

What does this print? (code)

What does this print?

import math
v = sorted([10, 20, 30, 40, 50, 60, 70, 80, 90, 1000])
print(v[math.ceil(0.5 * len(v)) - 1], sum(v) / len(v))
  1. A.55 145.0
  2. B.60 145.0
  3. C.50 145.0
  4. D.50 100.0
Answer & explanation

Correct answer: 50 145.0

The nearest-rank median is the 5th value, 50; the single 1000 ms request pulls the average up to 145.0.

Can you get the rest right without peeking?

Take the timed Quiz: Load Testing and Capacity Planning quiz free. Pass it to earn XP and count towards your certificate.

Start the quiz →