fork download
  1. from collections import namedtuple
  2.  
  3. names = list("abcdefgh")
  4. Attrs = namedtuple('Attrs', names)
  5.  
  6. d = dict.fromkeys(names, '')
  7. print Attrs(**d) # -> Attrs(a='', b='', c='', d='', e='', f='', g='', h='')
Success #stdin #stdout 0.03s 6732KB
stdin
Standard input is empty
stdout
Attrs(a='', b='', c='', d='', e='', f='', g='', h='')