"Magnus Lie Hetland" <mlh at idi.ntnu.no> wrote in message news:<9t9h3j$7r9$1 at tyfon.itea.ntnu.no>... > Well... If you want an evil solution: > locals()[['a','b'][idx]] = val Two more: exec '%s=val'%'ab'[idx] exec '%x=val'%(10+idx) Hung Jung :)