Re: [Tutor] Unpack from list

2015-07-13 Thread Alan Gauld
On 13/07/15 13:27, Mark Lawrence wrote: Hence:- >>> a,b,*c=[1,2] >>> a,b,c (1, 2, []) Neat! a new one on me. -- Alan G Author of the Learn to Program web site http://www.alan-g.me.uk/ http://www.amazon.com/author/alan_gauld Follow my photo-blog on Flickr at: http://www.flickr.com/photos/a

Re: [Tutor] Unpack from list

2015-07-13 Thread Mark Lawrence
On 13/07/2015 13:03, Sunil Tech wrote: Hi Tutor, [a,b,c] = [1,2] this will give Traceback (most recent call last): File "", line 1, in ValueError: need more than 2 values to unpack But is there any chance, if there are 3 values on left hand side and 2 values on right side, to add an empty

[Tutor] Unpack from list

2015-07-13 Thread Sunil Tech
Hi Tutor, [a,b,c] = [1,2] this will give Traceback (most recent call last): File "", line 1, in ValueError: need more than 2 values to unpack But is there any chance, if there are 3 values on left hand side and 2 values on right side, to add an empty value to the left side dynamically? there