+ 1
Why it delete the last element of list?
>>> lst=[1,2,3,4,5,6,7,8,9] >>> lst.pop() >>> print(lst) [1,2,3,4,5,6,7,8]
6 Answers
+ 4
Pop() without any parameter(index) will remove last element from the list...
+ 4
Samba
Yes
+ 2
With no parameter, it default is to delete last one
+ 2
If you call pop without arguments it deletes an item at index -1 by default.
+ 1
Pop() is used to delete the elements
If u use without index it will automatically delete last element in the list
0
Pop method property is to eliminate last element.
Hot today
Python — File Handling
2 Votes
Help me
0 Votes
What’s wrong?
2 Votes
Question is write a c program to print prime numbers up to n and print the largest number in array.
1 Votes
Achievements on Sololearn
1 Votes
How to draw in the console?
0 Votes