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
606 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
• 58,100 points
339 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, 2019 in Python by Nisa
• 1,090 points
8,997 views
0 votes
2 answers
+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, 2019 in Python by Neha
• 330 points

edited Jul 8, 2019 by Kalgi 1,976 views
0 votes
0 answers
+4 votes
6 answers

Lowercase in Python

You can simply the built-in function in ...READ MORE

answered Apr 11, 2018 in Python by hemant
• 5,810 points
1,508 views
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
117 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
108 views