Home
Python Tutorial
Introduction
Data Type
Statement
Operator
String
Tuple
List
Dictionary
Collections
Function
Class
File
Buildin Function
Buildin Module
Database
Regular Expressions
Thread
Tkinker
wxPython
XML
Network
CGI Web
Windows
Menu
Extend with list : Extend « List « Python Tutorial
Python Tutorial
List
Extend
list1 = [
"One"
,
"Two"
,
"Three"
] list2 = [
"Five"
,
"Six"
] list1.extend(list2) print list1
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