Life is more strict than a teacher

Life is more strict than a teacher
A teacher teaches a lesson
and takes an exam.
.
.
.
.
But life takes an exam
and then teaches a lesson.