The extend method appends several values at once by supplying a sequence of the values : Extend « List « Python Tutorial






a = [1, 2, 3]
b = [4, 5, 6]
a.extend(b)
print a








7.10.Extend
7.10.1.The extend method appends several values at once by supplying a sequence of the values
7.10.2.Extend with list
7.10.3.The Difference Between Extend and Append