On Thu, Dec 13, 2012 at 1:39 PM, Daniel Fetchinson
<fetchin...@googlemail.com> wrote:
>> If you know the sequence has at least n items, you
>> can do a, b, c = seq[:3]
>
> Yeah, that's probably the simplest, without all the fancy stuff :)

That only works for sequences, though.  Not all iterables are
sequences.  The islice version proposed by MRAB is more generally
applicable.
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to