0
What is the difference b/w append and insert
.
11 ответов
+ 5
Hope I understood your question clearly.
Might be you're talking about append and insert in lists.
Append always adds the item at the end of the list.
And with insert, you can specify in which position you want to add that particular item to the list.
For example:-
s=[1,2,3,4]
s.append(5)
print(s) # prints [1,2,3,4,5]
s.insert(6,0) # prints [6,1,2,3,4,5]
As ~ swim ~ said please take some time to frame your question properly
+ 4
Bagon
Didn't answered in more detail.
He might have done it in the course. The main question was what's the main difference between them. So, I a answered that only..
+ 1
Ya i'm talking about python
+ 1
Ohh , thanks BAGON
+ 1
Thanks bro
0
Ya it should be (0,"6")
0
Append adds things to a list
Insert inserts in the position you give as input