a list/re problem

Aahz aahz at pythoncraft.com
Mon Dec 28 20:35:22 EST 2009


In article <mailman.1744.1260564589.2873.python-list at python.org>,
Ed Keith  <e_d_k at yahoo.com> wrote:
>
>I have a list call it 'l':
>
>l = ['asc', '*nbh*', 'jlsdjfdk', 'ikjh', '*jkjsdfjasd*', 'rewr']
>
>Notice that some of the items in the list start and end with an '*'. I
>wish to construct a new list, call it 'n' which is all the members of l
>that start and end with '*', with the '*'s removed.

What kind of guarantee do you have that the asterisk will only exist on
the first and last character, if at all?
-- 
Aahz (aahz at pythoncraft.com)           <*>         http://www.pythoncraft.com/

Looking back over the years, after I learned Python I realized that I
never really had enjoyed programming before.



More information about the Python-list mailing list