Medium
Debug and Explain Logic Error
Analyze a code snippet to find a logic error and explain the fix.
📝 프롬프트 내용
Review the following code snippet that is intended to calculate the average of a list of numbers but is returning incorrect results. Identify the logic error, explain why it causes the wrong output, and rewrite the function with the correction.