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
The Difference Between Extend and Append : Extend « List « Python Tutorial
Python Tutorial
List
Extend
li = [
'a'
,
'b'
,
'c'
] li.extend([
'd'
,
'e'
,
'f'
]) print li print len(li) print li[-1]
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