Skip to content

Instantly share code, notes, and snippets.

@ishashankkumar
Created November 20, 2019 10:01
Show Gist options
  • Save ishashankkumar/bcbd7b878e10d6a79ce5de410b8f9964 to your computer and use it in GitHub Desktop.
Save ishashankkumar/bcbd7b878e10d6a79ce5de410b8f9964 to your computer and use it in GitHub Desktop.
>>> a = [1, 2, 3, 4, 2, 6, 7]
>>> del a[2] # Deletes element at index 2.
>>> print a
[1, 2, 4, 2, 6, 7]
>>> del a[1:3] # Deletes elements from index upto index 3.
>>> print a
[1, 2, 6, 7]
>>> del a[:] # Deletes every content of the list.
>>> print a
[]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment