When VALER is combined with a pena (the penalty), it takes on the meaning of to be worth (it). You’ll often hear it used in the past tense and shortened to, valeu – for short.
Não vale a pena. It's not worth it.
Valeu a pena! It was worth it!
Valeu! It was worth it!
It’s often used to say, thanks and is substituted for obrigado/a.
Valeu meu amigo! Thanks my friend!