for manipulating individual itemsthe _getitem_ (method can return an item by key value the key can be any python object but is typically an integer for sequences the _setitem_ (method assigns value to an element the _delitem_ (method is invoked whenever the del operation is applied to single element the _contains_ (method is used to implement the in operator the slicing operations such as [ :jare also implemented using _getitem_ () _setitem_ ()and _delitem_ (howeverfor slicesa special slice object is passed as the key this object has attributes that describe the range of the slice being requested for examplea [ , , , , , [ : [ : [ , , del [ : _getitem_ (slice( , ,none) _setitem_ (slice( , ,none)[ , , ] _delitem_ (slice( , ,none)the slicing features of python are actually more powerful than many programmers realize for examplethe following variations of extended slicing are all supported and might be useful for working with multidimensional data structures such as matrices and arraysa [ : : strided slice (stride= [ : : multidimensional slice [ : : : : multiple dimensions with strides [ : : extended slice assignment del [: :extended slice deletion the general format for each dimension of an extended slice is : [:stride]where stride is optional as with ordinary slicesyou can omit the starting or ending values for each part of slice in additionthe ellipsis (written as is available to denote any number of trailing or leading dimensions in an extended slicea : [ : extended slice access with ellipsis when using extended slicesthe _getitem_ () _setitem_ ()and _delitem_ (methods implement accessmodificationand deletionrespectively howeverinstead of an integerthe value passed to these methods is tuple containing combination of slice or ellipsis objects for examplea [ : : : invokes _getitem_ (as followsa _getitem_ ((slice( , ,none)slice( , , )ellipsis)python stringstuplesand lists currently provide some support for extended sliceswhich is described in special-purpose extensions to pythonespecially those with scientific flavormay provide new types and objects with advanced support for extended slicing operations iteration if an objectobjsupports iterationit must provide methodobj _iter_ ()that returns an iterator object the iterator object iterin turnmust implement single methoditer next((or iter _next_ (in python )that returns the next object or raises stopiteration to signal the end of iteration both of these methods are used by the implementation of the for statement as well as other operations that lib fl ff