I am passing in a variable number of lists in *args to a function. What I'd like to accomplish is to pass this args to zip().
def amv(db, *args):
x = zip(args)
return x
I would like to avoid the following:
if len(args) == 1:
x = zip(args[1])
elif len(args) == 2:
x = zip(args[1], args[2])
...etc.
Erm... you almost have it.
x = zip(*args)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With