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
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
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