

- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
How does del operator work on list in Python?
The del operator removes a specific index from given list. For example, if you want to remove the element on index 1 from list a, you'd use:
Example
a = [3, "Hello", 2, 1] del a[1] print(a)
Output
This will give the output −
[3, 2, 1]
Note that del removes the elements in place, ie, it doesn't create a new list.
- Related Questions & Answers
- How does the del operator work on a tuple in Python?
- How does * operator work on list in Python?
- How does in operator work on list in Python?
- How does concatenation operator work on list in Python?
- How does repetition operator work on list in Python?
- How does concatenation operator work on tuple in Python?
- How does the * operator work on a tuple in Python?
- How does the repetition operator work on a tuple in Python?
- How does the 'in' operator work on a tuple in Python?
- JavaScript : Why does % operator work on strings? - (Type Coercion)
- How does the Comma Operator work in C++
- How does a list work in Java?
- How does comparison operator work with date values in MySQL?
- How does Python while loop work?
- How does tuple comparison work in Python?
Advertisements