medium
Python Code Debugging
Identify and fix a logic error in Python code.
📝 Prompt Content
Analyze the following Python code snippet that is intended to calculate the average of a list of numbers but returns an incorrect result. Identify the logic error, explain why it is happening, and provide the corrected code block. The input list may contain non-integer values, so handle potential type errors gracefully.