What is the difference between append() and extend() methods?
Last updated 3 years, 6 months ago | 1450 views 75 5
Python | append() and extend() Function
Both append() and extend() methods are methods used to add elements at the end of a list.
- append(element): append() method adds the given element at the end of the list.
- extend(another-list): extend() method adds the elements of another list at the end of the list.