I'm looking for a way to flatten lists inside a list literal, kind of like
this:
>>> start = '('
>>> end = ')'
>>> items = ['abc', '+', 'def']
>>> [start, *items, end]
['(', 'abc', '+', 'def', ')']
Of course, the star doesn't work there. Is there any easy,
syntactically-lightweight way to get tha
Andre Engels gmail.com> writes
> Is:
>
> [start] + items + [end]
>
> lightweight enough?
Oh man, duh. I knew it was something simple. Thanks :)
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org