Intermediate
Debug a Python Script
Find and fix a specific error in a code snippet.
📝 Nội dung Prompt
I am receiving an 'IndexError: list index out of range' in my Python script. The code is: data = [1, 2, 3]; print(data[3]). Explain why this error happens and provide the corrected code.