nice python solution

Hung Jung Lu hungjunglu at yahoo.com
Thu Nov 22 13:13:08 EST 2001


"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 :)



More information about the Python-list mailing list