List concatenation : List Cancatenation : List PYTHON examples


PYTHON examples » List » List Cancatenation »

 

List concatenation


List concatenation: speed
 
L = [12]
L = L + [3]            # concatenate: slower
print L

L.append(4)            # faster, but in-place
print L

L = L + [56]         # concatenate: slower
print L

L.extend([78])       # faster, but in-place
print L

L += [910]       # mapped to L.extend([910])
print L


           
         
  



Leave a Comment / Note


 
Verification is used to prevent unwanted posts (spam). .


PYTHON examples

 Navioo List
» List Cancatenation