In a function, I want to make sure arguments a and b have the same length. I want to raise an Exception for this if not complied. I know ValueError is for exception where an argument itself doesn't conform some particular criteria. Is ValueError an appropriate error to raise in this case where criteria is between arguments? If not, any standard Python exception more appropriate?
def func(a, b):
if len(a) != len(b):
raise ValueError("list a and list b must have the same length")