Can you dynamically create the arguments for the zip() function in python 2? -


i passing in variable number of lists in *args function. i'd accomplish pass args zip().

def amv(db, *args):     x = zip(args)     return x 

i avoid following:

if len(args) == 1:     x = zip(args[1]) elif len(args) == 2:     x = zip(args[1], args[2]) ...etc. 

erm... have it.

x = zip(*args) 

Comments

Popular posts from this blog

Line ending issue with Mercurial or Visual Studio -

python - Received unregistered task using Celery with Django -

c# - Delving into the world of XML (Windows Phone) Error I dont understand (The ' ' character, hexadecimal value 0x20, cannot be included in a name.) -