I am interested in creating a python function which takes in 2\*n arguments, where n can be variable. The first n arguments are compared to the second n arguments.

Essentially, if n=2 for example, the function **f(a1, a2, b1, b2)** would check that *(a1==b1 and a2==b2) or (a1==b2 and a2==b1)*. For n=3, the function **f(a1, a2, a3, b1, b2, b3)** would check that *(a1==b1 and a2==b2 and a3==b3) or (a1==b2 and a2==b3 and a3==b1) or (a1==b3 and a2==b1 and a3==b2)*

However, I would like the function to construct the conditional statement on the fly depending on the value of n.

This is probably a tall order and I can do my own research, but is there anyone who can point me in the right direction? This would be considered metaprogramming right? Does anyone know of a library that exists for this sort of thing?

Thanks,

-AA