Spacebar265 <spacebar...@gmail.com> wrote in
news:c86cd530-cee5-4de6-8e19-304c664c9...@c12g2000yqj.googlegroups.c
om: 

> On Feb 11, 1:06 am, Duncan Booth <duncan.bo...@invalid.invalid>
> wrote: 
[...]
>> >>> re.split("(\w+)", "The quick brown fox jumps, and falls
>> >>> over.")[1::2] 
>>
>> ['The', 'quick', 'brown', 'fox', 'jumps', 'and', 'falls',
>> 'over'] 
> 
> Using this code how would it load each word into a temporary
> variable. 

>>> import re
>>> list_name = re.split("(\w+)", "The quick brown fox jumps, and 
falls over.")[1::2]
>>> list_name[2]
'brown'

You see, temporary variables are set. Their names are spelled 
'list_name[x]', where x is an index into the list. If your plan was 
instead to have predefined names of variables, what would they be 
called? How many would you have? With list variables, you will have 
enough, and you will know their names.

-- 
rzed
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to