|
|
#1 (permalink) |
|
Status: Junior Member
Join Date: Nov 2008
Posts: 15
|
The del Statement in Python:-
The remove method removes a specific item from a list, if that item is in the list. Some situations might require that you remove an element from a specific index, regardless of the item that is stored at that index. This can be accomplished with the del statement. Here is an example of how to use the del statement: my-list = [l, 2, 3, 4, 5] print 'Before deletion:’, my-list del my-list [2] print 'After deletion:', my-list This code will display the following: Before deletion: [1, 2, 3, 4, 5] After deletion: [1, 2, 4, 5] |
|
|
|
![]() |
| Bookmarks |
| Tags |
| del statement, python |
| Thread Tools | |
| Display Modes | |
|
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| The switch statement in C++ Programming | dil se | Programming | 0 | 01-09-2009 05:11 AM |
| The if statement in C++ Programming | prem | Programming | 0 | 12-01-2008 11:11 AM |
| Using if Statement to Test a Condition in Flash | bunty | Graphics | 0 | 11-12-2008 11:15 AM |
| IDLE in Python | independent | Programming | 0 | 11-06-2008 10:20 AM |
| The ‘import’ Statement in Java | genius | Programming | 0 | 10-06-2008 12:14 PM |