Created
November 20, 2019 10:01
-
-
Save ishashankkumar/bcbd7b878e10d6a79ce5de410b8f9964 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
>>> 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