Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

List Method: list append vs extend

# list append vs extend

e = [1,2,3]
e.append(["a",[8]])
print(e)
# [1, 2, 3, ['a', [8]]]

u = [1,2,3]
u.extend(["a",[8]])
print(u)
# [1, 2, 3, 'a', [8]]
Source by xahlee.info #
 
PREVIOUS NEXT
Tagged: #List #list #append #extend
ADD COMMENT
Topic
Name
3+9 =