I never use those weapons myself but I suppose they can be good if used the right way. I am however fairly certain that both of them are dangerous to you(depending on luck)
The lightning bolt from the thunder hammer bounces just like from a wand of lightning, this means it can bounce right back at you and cause serious injury if you dont have any electricity resistance. Not sure about the damage it does, probably like a wand of lightning.
I've never really learned to use whips at all, I always manage to take a liking to other things. I understand the chameleon whip has a small chance of randomly polymorphing things it hits, this can obviously turn either for or against you.
My recommendation is to keep the hammer if you have electricity resistance, if not, get another weapon, quickly. Not sure about the whip though, I think it's a bit risky to use but likely alot of fun
. But do hang on to both of them since they both sell for a nice heap of cash.