446,285 Members | 1,659 Online
Need help? Post your question and get tips & solutions from a community of 446,285 IT Pros & Developers. It's quick & easy.

# Conjunction List

 P: n/a http://codepad.org/MV3k10AU I want to write like next one. def conjunction(number=a[1],name=b[1],size=c[1]): flag = a[0]==b[0]==c[0] if flag: for e in zip(number,name,size): print e conjunction(a,b,c) ----------------------------------------------------------------------------------------------------- function args receive sequence element: def somefunc(name=elm1[1], size=elm2[1], color=elm3[1]): for e in zip(name, size, color): print e, conjunction(a,b,c) ----------------------------------------------------------------------------------------------------- not like two case: ----------------------------------------------------------------------------------------------------- def somefunc(elm1, elm2, elm3): name = elm1[1]; size = elm1[1]; color = elm1[1] # best solution? for e in zip(name, size, color): print e, conjunction(a,b,c) ----------------------------------------------------------------------------------------------------- def somefunc(elm1, elm2, elm3, **attr): for e in zip(attr['name'], attr['size'], attr['color']): print e, conjunction(a,b,c, name=a[1], size=b[1], color=c[1]) # many args... ----------------------------------------------------------------------------------------------------- What's a good approach to get the conjunction nest-list-data? Jun 1 '08 #1