I hear Python is very good for pentesting. It has got good modules for that. But it's not a good framework, like Metasploit.
Any language that has good, easy string handling capabilities is a good match for penetration testing. This is why you see scripting languages as the most used languages in this sort of tasks.
To answer your question, they're just as good.
Is Python or Ruby good for penetration testing?