Difference between pop and delete methods

0 votes
Two methods are used to delete elements from a list in python - pop() and delete(). What is the difference between them? I've seen both being in different places.
Jun 25, 2018 in Python by nightshade
• 870 points
45 views

1 answer to this question.

0 votes
I think you mean del() and not delete().

del() simply removes an item from the list at the index specified.

pop() removes the item from the index and returns it.
answered Jun 25, 2018 by Hamartia's Mask
• 1,580 points

Related Questions In Python

0 votes
1 answer

Difference between del, remove and pop on lists

es, remove removes the first matching value, ...READ MORE

answered Aug 1, 2018 in Python by Priyaj
• 56,940 points
53 views
0 votes
1 answer

What is the difference between pop() and remove()?

Array elements can be removed using pop() ...READ MORE

answered Jun 20 in Python by Nisa
• 1,090 points
29 views
0 votes
1 answer

What's the difference in Qt between setVisible, setShown and show/hide

show() is just a convenience function for ...READ MORE

answered Apr 17, 2018 in Python by anonymous
1,300 views
+1 vote
2 answers

how can i count the items in a list?

Syntax :            list. count(value) Code: colors = ['red', 'green', ...READ MORE

answered Jul 6 in Python by Neha
• 330 points

edited Jul 8 by Kalgi 349 views
+4 votes
6 answers
0 votes
2 answers

Delete a character from pythons string

If you want to remove the 'J' ...READ MORE

answered Jun 12, 2018 in Python by anonymous
51 views
0 votes
1 answer

Modules and Packages

A module is a single file imported ...READ MORE

answered Jun 27, 2018 in Python by Hamartia's Mask
• 1,580 points
40 views