On Wed, May 13, 2009 at 9:17 PM, Wells wrote:
> 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'.
Did you think to try it at the interpreter? That exact syntax works,
thou
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.
Thanks!
--
http://mail.python.org/mailman/listinfo/python-list