Question:

Differentiate between append() and extend() methods. ?

Answer:

Both append() and extend() methods are the methods of list. These methods a re 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.


Keywords:

© 2017 QuizBucket.org