Jan-16-2020, 06:54 AM
(Jan-15-2020, 03:23 PM)DeaD_EyE Wrote: Then you should read the pep-3132 (Extended Iterable Unpacking).
PEP-s are (usually) good reads. Me likes unpacking in for-loop (especially if one wants to have mutable list as result):
>>> for item in [(1, 2, 3), (10, 11, 12)]: ... print(item[1:]) ... (2, 3) # slices are tuples (11, 12) >>> for first, *rest in [(1, 2, 3), (10, 11, 12)]: ... print(rest) ... [2, 3] # lists [11, 12]
I'm not 'in'-sane. Indeed, I am so far 'out' of sane that you appear a tiny blip on the distant coast of sanity. Bucky Katt, Get Fuzzy
Da Bishop: There's a dead bishop on the landing. I don't know who keeps bringing them in here. ....but society is to blame.
Da Bishop: There's a dead bishop on the landing. I don't know who keeps bringing them in here. ....but society is to blame.