Does "life" mean the same thing in these two sentences?

The battery had a short life.

While there's life there's hope.
different meanings