What is the difference between append() and extend() methods?

Last updated 3 weeks, 5 days ago | 24 views 75     5

Tags:- Python

Python | append() and extend() Function

Both append() and extend() methods are methods used to add elements at the end of a list.

  • append(element): Adds the given element at the end of the list that is called this append() method
  • extend(another-list): Adds the elements of another list at the end of the list that is called this extend() method