Quoted By:
Yes, but it's often marginal gains.
Suppose you have to pick the correct place with water (1) among 100. Their positions don't change.
You pick at random and it's one of the 99 wrong lots. You learned it's not place #73, but that's it. There's still a 1,01% odds of succeeding next time.
Now, if you got it right from the beginning, you'd have learned much more valuable information - that is the place with water!
This principle applies to all other areas in life: mastering a technique or learning a subject is all a game of choosing the correct path. And by succeeding you gain so much more than by failing.
But one could argue that if you're going the right way from the start, you're not learning anything new then, just practicing the ability you already had. By this inane definition, then yes: one not only learns by failure but ONLY by failure.
Still marginal gains when the odds are high, though.
TL;DR: One learns by failure. But either gets more exp by succeeding or none, depending on how one sees learning.