Conjunction List

ccy56781 at gmail.com ccy56781 at gmail.com
Sat May 31 20:01:31 EDT 2008


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?



More information about the Python-list mailing list