---
description: Python List data-type helps you to store items of different data types in an ordered sequence. The data is written inside square brackets ([]), and the values are separated by comma(,). In Python, there are many methods available on the list data type that help you remove an element from a given list.
title: Remove element from a Python LIST [clear, pop, remove, del]
image: https://www.guru99.com/images/remove-element-from-a-python-list.png
---

 

[Skip to content](#main) 

**⚡ Smart Summary**

Removing elements from a Python list relies on three built-in methods, remove(), pop(), and clear(), plus the del keyword, each targeting an item by value, by index, or clearing the entire list in place.

* 🔘 **remove() method:** remove() deletes the first element matching a given value and raises a ValueError when the value is absent.
* ☑️ **pop() method:** pop() removes an item at a given index and returns it, defaulting to the last element when no index is passed.
* ✅ **del keyword:** The del keyword deletes an item or a whole slice by index, and can also remove the list variable.
* 🧪 **clear() method:** clear() empties the list in place, leaving an existing but zero-length list behind.
* 🛠️ **Value versus index:** Use remove() when the value is known, and pop() or del when the position is known.
* 🤖 **AI workflows:** Machine learning data cleaning trims unwanted samples from lists using comprehensions before model training.

[ Read More ](javascript:void%280%29;) 

![Remove Element from a Python List]()

Python list data type helps you to store items of different data types in an ordered sequence. The data is written inside square brackets (\[\]), and the values are separated by comma(,).

In Python, there are many methods available on the list data type that help you remove an element from a given list. The methods are **remove(), pop()** and **clear()**.

Besides the list methods, you can also use a **del** keyword to remove items from a list.

## Example of list

my_list = ['Guru', 50, 11.50, 'Siya', 50, ['A', 'B', 'C']]

The index starts from 0\. In the list my\_list, at the 0th index we have the string ‘Guru’.

* At index: 1 you will get the number 50 which is an integer.
* At index:2 you will get the floating number 11.50
* At index:3, there is a string ‘Siya.’
* At index:4, you will see the number 50 is duplicated.
* At index:5, you will get a list with values A, B, and C.

## Python remove() method

The remove() method is a built-in method available with the list. It helps to remove the very first matching element from the list.

**Syntax:**

list.remove(element)

The element that you want to remove from the list.

**Return Value**

There is no return value for this method.

## Tips for using remove() method

Following are the important points to remember when using the remove() method:

* When the list has duplicate elements, the very first element that matches the given element will be removed from the list.
* If the given element is not present in the list, it will throw an error saying the element is not in the list.
* The remove() method does not return any value.
* The remove() method takes the value as an argument, so the value has to be passed with the correct data type.

### Example: Using remove() method to remove an element from the list

Here is a sample list that I have:

my_list = [12, 'Siya', 'Tiya', 14, 'Riya', 12, 'Riya']

The list has elements of data types string and number. The list has duplicate elements like the number 12 and the string Riya.

my_list = [12, 'Siya', 'Tiya', 14, 'Riya', 12, 'Riya']
my_list.remove(12) # it will remove the element 12 at the start.
print(my_list)
my_list.remove('Riya') # will remove the first Riya from the list
print(my_list)
my_list.remove(100)  #will throw an error
print(my_list)

**Output:**

['Siya', 'Tiya', 14, 'Riya', 12, 'Riya']
['Siya', 'Tiya', 14, 12, 'Riya']
Traceback (most recent calllast):
File "display.py", line 9, in <module>
    my_list.remove(100)
ValueError: list.remove(x): x not in the list

## Python pop() method

The pop() method removes an element from the list based on the index given.

**Syntax**

list.pop(index)

index: the pop() method has only one argument called index.

* To remove an element from the list, you need to pass the index of the element. The index starts at 0\. To get the first element from the list, pass the index as 0\. To remove the last element, you can pass the index as -1.
* The index argument is optional. If not passed, the default value is considered -1, and the last element from the list is returned.
* If the index given is not present, or out of range, the pop() method throws an error saying **IndexError: pop index.**

**Return Value:**

The pop() method will return the element removed based on the index given. The final list is also updated and will not have the element.

### Example: Using the pop() method to remove an element from the list

The list we will use in the example is my\_list = \[12, ‘Siya’, ‘Tiya’, 14, ‘Riya’, 12, ‘Riya’\].

Let us try to remove an element using a pop() method based on the following:

* By giving index
* Without index
* Passing index that is out of range.

Here, we are removing **Tiya** from the list. The index starts from 0, so the index for **Tiya** is 2.

my_list = [12, 'Siya', 'Tiya', 14, 'Riya', 12, 'Riya']

#By passing index as 2 to remove Tiya
name = my_list.pop(2)
print(name)
print(my_list)

#pop() method without index – returns the last element
item = my_list.pop()
print(item)
print(my_list)

#passing index out of range
item = my_list.pop(15)
print(item)
print(my_list)

**Output:**

Tiya
[12, 'Siya', 14, 'Riya', 12, 'Riya']
Riya
[12, 'Siya', 14, 'Riya', 12]
Traceback (most recent calllast):
File "display.py", line 14, in <module>
item = my_list.pop(15)
IndexError: popindex out of range

## Python clear() method

The clear() method will remove all the elements present in the list.

**Syntax:**

list.clear()

Parameters:

No parameters.

Return Value:

There is no return value. The list is emptied using the clear() method.

### Example: Using clear() method to remove all elements from the list

The clear() method will empty the given list. Let us see the working of clear() in the example below:

my_list = [12, 'Siya', 'Tiya', 14, 'Riya', 12, 'Riya']

#Using clear() method
element = my_list.clear()
print(element)
print(my_list)

**Output:**

None
[]

## Using del keyword

To remove an element from the list, you can use the **del** keyword followed by a list. You have to pass the index of the element to the list. The index starts at 0.

**Syntax:**

del list[index]

You can also slice a range of elements from the list using the **del** keyword. The start/stop index from the list can be given to the del keyword, and the elements falling in that range will be removed. The syntax is as follows:

**Syntax:**

del list[start:stop]

Here is an example that shows how to remove the first element, last element, and multiple elements from the list using **del**.

my_list = list(range(15))
print("The Original list is ", my_list)

#To remove the firstelement
del my_list[0]
print("After removing first element", my_list)

#To remove last element
del my_list[-1]
print("After removing last element", my_list)

#To remove element for given index : for example index:5
del my_list[5]
print("After removing element from index:5", my_list)

#To remove last 2 elements from the list
del my_list[-2]
print("After removing last 2 elements", my_list)

#To remove multiple elements
delmy_list[1:5]
print("After removing multiple elements from start:stop index (1:5)", my_list)

#To remove multiple elements
del my_list[4:]
print("To remove elements from index 4 till the end (4:)", my_list)

**Output:**

The Originallist is  [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14]
After removing first element [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14]
After removing last element [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13]
After removing element from index:5 [1, 2, 3, 4, 5, 7, 8, 9, 10, 11, 12, 13]
After removing last 2 elements [1, 2, 3, 4, 5, 7, 8, 9, 10, 11, 13]
After removing multiple elements from start:stop index (1:5) [1, 7, 8, 9, 10, 11, 13]
To remove elements from index 4 till the end (4:) [1, 7, 8, 9]

### RELATED ARTICLES

* [Python XML File – How to Read, Write & Parse ](https://www.guru99.com/manipulating-xml-with-python.html "Python XML File – How to Read, Write & Parse")
* [Copy File in Python: shutil.copy(), shutil.copystat() method ](https://www.guru99.com/python-copy-file.html "Copy File in Python: shutil.copy(), shutil.copystat() method")
* [Python Lambda Functions with EXAMPLES ](https://www.guru99.com/python-lambda-function.html "Python Lambda Functions with EXAMPLES")
* [Python len() Function: How to find length of the string ](https://www.guru99.com/python-string-length-len.html "Python len() Function: How to find length of the string")

## How do I remove the first element from a list?

You can make use of list methods like **remove(), pop()** to remove the first element from the list. In the case of the remove() method, you will have to pass the first element to be removed, and for pop() the index, i.e., 0.

You may also use the **del** keyword to remove the first element from the list.

The example below shows how to remove the first element from a list using remove(), pop() and del.

my_list1 = ['A', 'B', 'C', 'D', 'E', 'F']
print("The Originallist is ", my_list1)
#Using remove() to remove first element
my_list1.remove('A')
print("Using remove(), the final list is ", my_list1)

my_list1 = ['A', 'B', 'C', 'D', 'E', 'F']
print("The Originallist is ", my_list1)
#Using pop() to remove the first element
element = my_list1.pop(0)
print("The first element removed from my_list1 is ", element)
print("Using pop(), the final list is ", my_list1)

#Using del to remove the first element
my_list2 = ['A', 'B', 'C', 'D', 'E', 'F']
del my_list2[0]
print("Using del, the final list is ", my_list2)

**Output:**

The Originallist is  ['A', 'B', 'C', 'D', 'E', 'F']
Using remove(), the final list is  ['B', 'C', 'D', 'E', 'F']
The Originallist is  ['A', 'B', 'C', 'D', 'E', 'F']
The first element removed from my_list1 is  A
Using pop(), the final list is  ['B', 'C', 'D', 'E', 'F']
Using del, the final list is  ['B', 'C', 'D', 'E', 'F']

## How do I remove multiple elements from a list in Python?

The list methods remove() and pop() are meant to remove a single element. To remove multiple elements, make use of the **del** keyword.

From the list \[‘A’, ‘B’, ‘C’, ‘D’, ‘E’, ‘F’\], we want to remove elements B, C and D. The below example shows how to make use of the **del** keyword to remove the elements.

#Using del to remove the multiple elements from list
my_list2 = ['A', 'B', 'C', 'D', 'E', 'F']
print("Originallist is ", my_list2)
del my_list2[1:4]
print("Using del, the final list is ", my_list2)

**Output:**

Originallist is  ['A', 'B', 'C', 'D', 'E', 'F']
Using del, the final list is  ['A', 'E', 'F']

## How do I remove an element from a list by using index in Python?

To remove an element based on index, you can make use of the list method pop(). Even using the **del** keyword will help you to remove the element for a given index.

#Using del to remove the multiple elements from list
my_list1 = ['A', 'B', 'C', 'D', 'E', 'F']
print("Originallist is ", my_list1)
element = my_list1.pop(2)
print("Element removed for index: 2 is ", element)
print("Using pop, the final list is ", my_list1)

#Using del to remove the multiple elements from list
my_list2 = ['A', 'B', 'C', 'D', 'E', 'F']
print("Originallist is ", my_list2)
del my_list2[2]
print("Using del, the final list is ", my_list2)

**Output:**

Originallist is  ['A', 'B', 'C', 'D', 'E', 'F']
Element removed for index: 2 is  C
Using pop, the final list is  ['A', 'B', 'D', 'E', 'F']
Originallist is  ['A', 'B', 'C', 'D', 'E', 'F']
Using del, the final list is  ['A', 'B', 'D', 'E', 'F']

## FAQs

🗑️ What is the difference between remove(), pop(), and del in Python?

remove() deletes the first element that matches a value, pop() removes an item by index and returns it, and del removes an item or a slice by index without returning anything. Choose by whether you know the value or the position.

🔁 How do you remove all occurrences of an element from a list?

remove() deletes only the first match, so use a list comprehension such as \[x for x in my\_list if x != value\]. This rebuilds the list without any matching item and keeps the remaining order intact.

🔄 How do you safely remove items while looping through a list?

Modifying a list while iterating forward skips elements. Iterate over a copy, loop in reverse, or build a new list with a comprehension. The comprehension approach is the most readable and avoids index-shifting bugs entirely.

🧹 What is the difference between clear() and del for emptying a list?

clear() empties the list in place while keeping the variable and any references pointing to the same now-empty list. del my\_list removes the variable entirely, so referencing it afterward raises a NameError.

📋 Do these methods modify the original list or return a new one?

remove(), pop(), clear(), and del all change the list in place. Only pop() returns the removed element; the others return None or nothing. A list comprehension instead builds a separate new list and leaves the original untouched.

🚀 Which is the fastest way to remove many elements from a large list?

Calling remove() repeatedly is slow because each call re-scans the list. Rebuilding with a single list comprehension or filter() runs in one pass and is far faster for large lists when removing many values.

🤖 How is list element removal used in AI and machine learning workflows?

Data preparation for machine learning often removes unwanted samples, outliers, or invalid labels from lists before converting them to arrays. Clean removal with comprehensions or pandas keeps training data consistent and prevents skewed model results.

✨ Can GitHub Copilot or agentic AI tools generate Python list-removal code?

Yes. GitHub Copilot and agentic AI assistants generate remove(), pop(), del, and comprehension-based code from a plain comment, suggest the safest option for your case, and refactor loops, though you should still test edge cases like missing values.

#### Summarize this post with:

ChatGPT Perplexity Grok Google AI 

**Stay Updated on AI** **Get Weekly AI Skills, Trends, Actionable Advice.** 

##### Sign up for the newsletter

Subscribe for Free 

You have successfully subscribed.  
Please check your inbox. 

![AI-Newsletter]() Chosen by over **350,000+** professionals 

[Scroll to top ](#wrapper)Scroll to top 

× 

Toggle Menu Close 

Search for: 

Search

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://www.guru99.com/#organization","name":"Guru99","sameAs":["https://www.facebook.com/Guru99Official","https://twitter.com/guru99com"],"logo":{"@type":"ImageObject","@id":"https://www.guru99.com/#logo","url":"https://www.guru99.com/images/guru99-logo-v1-150x59.png","contentUrl":"https://www.guru99.com/images/guru99-logo-v1-150x59.png","caption":"Guru99","inLanguage":"en-US"}},{"@type":"WebSite","@id":"https://www.guru99.com/#website","url":"https://www.guru99.com","name":"Guru99","publisher":{"@id":"https://www.guru99.com/#organization"},"inLanguage":"en-US"},{"@type":"ImageObject","@id":"https://www.guru99.com/images/remove-element-from-a-python-list.png","url":"https://www.guru99.com/images/remove-element-from-a-python-list.png","width":"700","height":"250","caption":"Remove element from a Python LIST","inLanguage":"en-US"},{"@type":"BreadcrumbList","@id":"https://www.guru99.com/python-list-remove-clear-pop-del.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":"1","item":{"@id":"https://www.guru99.com","name":"Home"}},{"@type":"ListItem","position":"2","item":{"@id":"https://www.guru99.com/python","name":"Python"}},{"@type":"ListItem","position":"3","item":{"@id":"https://www.guru99.com/python-list-remove-clear-pop-del.html","name":"Remove element from a Python LIST [clear, pop, remove, del]"}}]},{"@type":"WebPage","@id":"https://www.guru99.com/python-list-remove-clear-pop-del.html#webpage","url":"https://www.guru99.com/python-list-remove-clear-pop-del.html","name":"Remove element from a Python LIST [clear, pop, remove, del]","dateModified":"2026-07-11T11:01:53+05:30","isPartOf":{"@id":"https://www.guru99.com/#website"},"primaryImageOfPage":{"@id":"https://www.guru99.com/images/remove-element-from-a-python-list.png"},"inLanguage":"en-US","breadcrumb":{"@id":"https://www.guru99.com/python-list-remove-clear-pop-del.html#breadcrumb"}},{"@type":"Person","@id":"https://www.guru99.com/author/anna","name":"Anna Blake","description":"I'm Anna Blake, specializing in Python tutorials, offering clear and concise lessons to help you master Python programming efficiently.","url":"https://www.guru99.com/author/anna","image":{"@type":"ImageObject","@id":"https://www.guru99.com/images/anna-blake-author.png","url":"https://www.guru99.com/images/anna-blake-author.png","caption":"Anna Blake","inLanguage":"en-US"},"worksFor":{"@id":"https://www.guru99.com/#organization"}},{"articleSection":"Python","headline":"Remove element from a Python LIST [clear, pop, remove, del]","description":"Python List data-type helps you to store items of different data types in an ordered sequence. The data is written inside square brackets ([]), and the values are separated by comma(,). In Python, there are many methods available on the list data type that help you remove an element from a given list.","keywords":"python","speakable":{"@type":"SpeakableSpecification","cssSelector":[".entry-title",".summary"]},"@type":"Article","author":{"@id":"https://www.guru99.com/author/anna","name":"Anna Blake"},"dateModified":"2026-07-11T11:01:53+05:30","image":{"@id":"https://www.guru99.com/images/remove-element-from-a-python-list.png"},"copyrightYear":"2026","name":"Remove element from a Python LIST [clear, pop, remove, del]","subjectOf":[{"@type":"FAQPage","mainEntity":[{"@type":"Question","name":"What is the difference between remove(), pop(), and del in Python?","acceptedAnswer":{"@type":"Answer","text":"remove() deletes the first element that matches a value, pop() removes an item by index and returns it, and del removes an item or a slice by index without returning anything. Choose by whether you know the value or the position."}},{"@type":"Question","name":"How do you remove all occurrences of an element from a list?","acceptedAnswer":{"@type":"Answer","text":"remove() deletes only the first match, so use a list comprehension such as [x for x in my_list if x != value]. This rebuilds the list without any matching item and keeps the remaining order intact."}},{"@type":"Question","name":"How do you safely remove items while looping through a list?","acceptedAnswer":{"@type":"Answer","text":"Modifying a list while iterating forward skips elements. Iterate over a copy, loop in reverse, or build a new list with a comprehension. The comprehension approach is the most readable and avoids index-shifting bugs entirely."}},{"@type":"Question","name":"What is the difference between clear() and del for emptying a list?","acceptedAnswer":{"@type":"Answer","text":"clear() empties the list in place while keeping the variable and any references pointing to the same now-empty list. del my_list removes the variable entirely, so referencing it afterward raises a NameError."}},{"@type":"Question","name":"Do these methods modify the original list or return a new one?","acceptedAnswer":{"@type":"Answer","text":"remove(), pop(), clear(), and del all change the list in place. Only pop() returns the removed element; the others return None or nothing. A list comprehension instead builds a separate new list and leaves the original untouched."}},{"@type":"Question","name":"Which is the fastest way to remove many elements from a large list?","acceptedAnswer":{"@type":"Answer","text":"Calling remove() repeatedly is slow because each call re-scans the list. Rebuilding with a single list comprehension or filter() runs in one pass and is far faster for large lists when removing many values."}},{"@type":"Question","name":"How is list element removal used in AI and machine learning workflows?","acceptedAnswer":{"@type":"Answer","text":"Data preparation for machine learning often removes unwanted samples, outliers, or invalid labels from lists before converting them to arrays. Clean removal with comprehensions or pandas keeps training data consistent and prevents skewed model results."}},{"@type":"Question","name":"Can GitHub Copilot or agentic AI tools generate Python list-removal code?","acceptedAnswer":{"@type":"Answer","text":"Yes. GitHub Copilot and agentic AI assistants generate remove(), pop(), del, and comprehension-based code from a plain comment, suggest the safest option for your case, and refactor loops, though you should still test edge cases like missing values."}}]}],"@id":"https://www.guru99.com/python-list-remove-clear-pop-del.html#schema-1140673","isPartOf":{"@id":"https://www.guru99.com/python-list-remove-clear-pop-del.html#webpage"},"publisher":{"@id":"https://www.guru99.com/#organization"},"inLanguage":"en-US","mainEntityOfPage":{"@id":"https://www.guru99.com/python-list-remove-clear-pop-del.html#webpage"}}]}
```
