🎙 Free live masterclass · Sun, 29 Nov, 7:00 pm IST · Java Full Stack roadmap Register free →
Skills101
← Quiz: How AI Coding Assistants Work: all 10 questions

Quiz: How AI Coding Assistants Work · Question 4 of 10

What did averagemarks([]) do in the demo?

What did average_marks([]) do in the demo?

  1. A.Returned 0
  2. B.Returned None
  3. C.Raised ZeroDivisionError
  4. D.Returned an empty list
Answer & explanation

Correct answer: Raised ZeroDivisionError

sum([]) / len([]) divides by zero. The empty-list behaviour was never specified.

Can you get the rest right without peeking?

Take the timed Quiz: How AI Coding Assistants Work quiz free. Pass it to earn XP and count towards your certificate.

Start the quiz →