Operator Functions
operator.delitem()
Delete a[b] from a mutable target; missing keys or invalid indices can raise exceptions.
Formal Syntax & Structure
python syntaxpython
operator.delitem(a, b, /)Parameters & Attributes
| Name | Type | Description |
|---|---|---|
| a | object | Left operand or target object. |
| b | object | Index, slice or mapping key. |
Return Value
None
Returns None after performing the indicated mutation.
Working Example
Example Snippetpython
import operatordata=[1,2,3]print(operator.delitem(data,1))print(data)