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
• 880 points
2,123 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,020 points
1,064 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
28,471 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 7, 2019 in Python by Neha
• 330 points

edited Jul 8, 2019 by Kalgi 4,434 views
0 votes
1 answer
+5 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,790 points
4,071 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
699 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
630 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP