In this Python Programming video tutorial you will learn the basic difference between append and extend methods in detail.
Here in this tutorial first we'll see what is append method, this append method is used to add the element at the end of the list.
So next we discussed about the extend method, this method is used to add the elements at the end of the list.
The difference between append and extend is
in the append we will add single element at the end of the list but here in the extend we will append the all the elements of the iterables .And in append we can add any list, string or any number to the list, but in extend only we can add the elements of a iterables .
So third difference is in the append method the length of the list will be incremented by one. that's because in the append function we will add single value at the end of the list. So length of the list will be incremented by 1, but in extend method length increment will be based on how many elements present in that iterables .
For more free tutorials on computer programming
/ amulsacademy
/ amulsacademy
In questa pagina del sito puoi guardare il video online Python Tutorial - append vs extend methods della durata di ore minuti seconda in buona qualità , che l'utente ha caricato Amulya's Academy 03 January 2018, condividi il link con amici e conoscenti, su youtube questo video è già stato visto 41,061 volte e gli è piaciuto 913 spettatori. Buona visione!