Is lesson used to mean the same thing in the next two sentences?

The accident was a good lesson to me.

He did the lesson for today.
different meanings