Scroll Down to See All▾
absaiterallanextanyasciibinboolbreakpointbytearraybytescallablechrclassmethodcompilecomplexdelattrdictdivmodenumerateevalexecfilterfloatformatfrozensetgetattrglobalshasattrhashhelphexidinputintisinstanceissubclassiterlenlistlocalsmapmaxmemoryviewminnextobjectoctopenordpowprintpropertyrangereprreversedroundsetsetattrsortedstaticmethodstrsumsupertupletypevarszip__import__clear_(dict)clear_(list)clear_(set)copy_(dict)copy_(list)copy_(set)fromkeysgetitemskeyspop_(dict)pop_(list)pop_(set)popitemsetdefaultupdatevaluescount_(tuple)count_(list)count_(str)index_(tuple)index_(list)index_(str)adddifferencedifference_updatediscardintersectionintersection_updateisdisjointissubsetissupersetremove_(set)remove_(list)symmetric_differencesymmetric_difference_updateunionupdateclosefilenoflushisattyreadreadablereadlinereadlinesseekseekabletelltruncatewritablewritewritelinesappendextendinsertreversesortcapitalizecasefoldcenterencodeendswithexpandtabsfindformatisalnumisalphaisasciiisdecimalisdigitisidentifierislowerisnumericisprintableisspaceistitleisupperjoinljustlowerlstripmaketranspartitionreplacerfindrindexrjustrpartitionrsplitrstripsplitsplitlinesstartswithstripswapcasetitletranslateupperdirzfillFunction Details: slice
Description
Creates a slice object. Used for extended slicing (e.g. a[start:stop:step]).
Extended Description
The slice() function returns a slice object representing the set of indices specified by range(start, stop, step). It's used for extended slicing of sequences. A slice object can be used with any sequence type (string, list, tuple, etc.) to extract a subset of elements. The slice object itself is immutable.
Read More about slice from Python Documentation
Function Signature
slice(start: Optional[int], stop: Optional[int], step: Optional[int] = None) -> slice
Module: builtins
Class: slice
Parameters
Parameter List
- start: Optional[int]
- stop: Optional[int]
- step: Optional[int]
Return
Returns a slice object.
Return Type
slice
Output
Explanation
This example shows how to create and use a slice object with different sequence types.