Absolutely. Failure is first ingredient in the recipe to success. I'm a Kansas City Royals fan and endured losing seasons for most of my life. Typically, by the All Star break the team was well outside of playoff contention and still had pretty much meaningless games to play. I used to wonder why the players don't just mail it in. They're there to improve themselves. They are there to earn a new, hopefully better, contract. They are there, working hard, to improve their situation. At that point, the final score doesn't matter. It's about personal improvement.
Using the baseball analogy, if you get out and quit, you aren't sweating and you aren't winning. Sweating is trying and persevering through success and failure. And sweating like that is winning in my book.