Jabin Jezreel wrote:
What you are doing is already fine although you can drop the starting index for the first sliceWhat is the idiomatic way to write the right side of (a, b) = (l[0:2], l[2:]) ? (not worried about the parens, just the splitting of the sequence)------------------------------------------------------------------------ _______________________________________________ Tutor maillist - [email protected] http://mail.python.org/mailman/listinfo/tutor
>>> l=[1,2,3,4,5,6,7,8,9,10] >>> l[:2], l[2:] ([1, 2], [3, 4, 5, 6, 7, 8, 9, 10]) -- Kind Regards, Christian Witts _______________________________________________ Tutor maillist - [email protected] http://mail.python.org/mailman/listinfo/tutor
