Answer:
When someone who didn't study for the exam blame his inability to pass the exam on his luck.
Step-by-step explanation:
Attribution error occurs when people diver the cause of a situation that supposed to be internal into something external.
In the example above, the reason why that student fail the exam is because he come to the exam room unprepared. But rather than acknowledging his mistake, he rather blame all of it on luck (which is outside of his control) in order to protect his own ego. In such situation, that student has comitted an attribution error.