SyntaxFix
Write A Post
Hire A Developer
Questions
If you want to get a sub list including the last element, you leave blank after colon:
>>> ll=range(10) >>> ll [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] >>> ll[5:] [5, 6, 7, 8, 9] >>> ll[:] [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]