Differentiate between append() and extend() methods: Both append() and extend() methods are the methods of list. These methods are used to add the elements at the end of the list. *) append(element) – adds the given element at the end of the list which has called this method. *) extend(another-list) – adds the elements of another-list at the end of the list which is called the extend method.
Differentiate between append() and extend() methods:
Both append() and extend() methods are the methods of list. These methods are used to add the elements at the end of the list.
*) append(element) – adds the given element at the end of the list which has called this method.
*) extend(another-list) – adds the elements of another-list at the end of the list which is called the extend method.