def lengths(*args):
 results = []
 for arg in args:
  try:
   arglen = len(arg)
  except TypeError:
   arglen = None
  results.append((arglen, arg))
 return results

def lengths ( * args ) : results = [ ] for arg in args : try : arglen = len ( arg ) except TypeError : arglen = None results . append ( ( arglen , arg ) ) return results
measure the length of each input argument .