96103/what-difference-between-python-list-methods-append-extend
Appends object at the end.
x = [1, 2, 3] x.append([4, 5]) print (x)
gives you: [1, 2, 3, [4, 5]]
Extends list by appending elements from the iterable.
x = [1, 2, 3] x.extend([4, 5]) print (x)
gives you: [1, 2, 3, 4, 5]
Python's list methods append and extend add ...READ MORE
List has [ ] brackets while tuple ...READ MORE
Only in Windows, in the latter case, ...READ MORE
Python append() method adds an element to ...READ MORE
suppose you have a string with a ...READ MORE
You can also use the random library's ...READ MORE
Syntax : list. count(value) Code: colors = ['red', 'green', ...READ MORE
Enumerate() method adds a counter to an ...READ MORE
There is a simple difference between append ...READ MORE
Hi, @Roshni, You can follow a few steps ...READ MORE
OR
At least 1 upper-case and 1 lower-case letter
Minimum 8 characters and Maximum 50 characters
Already have an account? Sign in.