Assigning multiple variables to a list a la php's list()

Wells wells at
Thu May 14 00:17:45 EDT 2009

Can you take a list and have it exploded into variables w/ one
command? Something like..

list = ['foo', 'bar']
[a, b] = list

Then 'a' would be foo and 'b' 'bar'.

Like list($a,$b) = $list in PHP.


More information about the Python-list mailing list