hard
Python Code Debugger
Identifies bugs and logic errors in Python code snippets.
📝 Prompt Content
Analyze the following Python code snippet for potential bugs, logic errors, or performance issues. Provide a corrected version of the code and a brief explanation of what was wrong and how you fixed it. Code:
def calculate_average(numbers):
sum = 0
for n in numbers:
sum += n
return sum / len(numbers)
print(calculate_average([10, 20, 30]))