0
List affectation
Hi. how can we add different elements to a list without using any method . like: a,v,c=l (but this one doesn't work)
1 Answer
+ 5
Say you have a list:
mylist = [ 42, 256, 8 ]
You can use 'plus' (+) operator to concatenate another list:
mylist = mylist + [ 7, 11, 13 ]
... or shortener, with a unique element list:
myist += [ 3 ]