The starting and ending indices can exceed the length of the string. : Slice : List PYTHON TUTORIALS
Ajax
Ajax Examples
Ajax Tutorials
Scripts and Programs
Javascript
Javascript Examples Tutorials
DHTML Tutorials
Javascript References
Scripts and Programs
HTML
HTML Tutorials
HTML References
HTML DOM 0 References
HTML DOM 2 References
CSS
CSS Tutorials
CSS References
PHP
PHP Source Code
PHP References
Scripts and Programs
C#
C# Source Code
C# Examples
PYTHON TUTORIALS
»
List
»
Slice
»
The starting and ending indices can exceed the length of the string.
print
(
'A'
,
'B'
,
'C'
)[
-
100
:
100
]
Related Scripts with Example Source Code in same category :
Slicing to access ranges of elements
LHS slice and the RHS may each be of any length
Slicing Shorthand
The first is inclusive, and the second is exclusive
Slice more than what you have
Slice from the end
If the slice continues to the end of the sequence, you may simply leave out the last index
If the slice continues to the start of the sequence, you may simply leave out the first index
copy the entire sequence, you may leave out both indices
Another parameter, which normally is left implicit, is the step length
A step size of two will include only every other element of the interval between the start and the end
if you want every fourth element of a sequence, you only have to supply a step size of four
Negative step size
Slicing a List
End slice
Middle slice
Negative Indices
Revese and skip
Leave a Comment / Note
Name (required)
email (will not be published) (required)
Website
Vérification
Refresh
Enter code
Verification is used to prevent unwanted posts (spam). .
PYTHON TUTORIALS
List
»
Slice
Introduction
Length
Append
List Comprehension
Assignment
Loop through
Compare List
Max
Concatenate
Member in
Convert to list
Min
Count
Multiply
Delete
Pop
Enumerate
Reverse
Extend
Slice
Index Search
Sort
Index
Sum
Insert
Buildin Function
Buildin Module
CGI Web
Class
Collections
Data Type
Database
Dictionary
File
Function
Introduction
List
Network
Operator
Regular Expressions
Statement
String
Thread
Tkinker
Tuple
Windows
WxPython
XML