KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
Is there any difference between these three methods to remove an element from a list in Python? a = [1, 2, 3] a.remove(2) a # [1, 3] a = [1, 2, 3] del a[1] a # [1, 3] a = [1, 2, 3] a.pop(1) # 2 a # [1, 3]
Tags (comma-separated)
Save Edits
Cancel