๐ŸŒ
LinkedIn
linkedin.com โ€บ pulse โ€บ cheat-sheet-python-list-comprehension-nicholas-key
Cheat sheet to slice a list in Python
March 8, 2018 - I thought of sharing this cheat sheet that is easy enough to understand and might be useful for anyone that codes in Python or would like to know more about the various ways to slice a list in Python. My personal experience with slicing a list in Python is summarized in this image so that you may fi
Discussions

A Comprehensive Guide to Slicing in Python
The start/end indexing when going in reverse has always taken a level of extra mental effort that I don't like. Like excluding the first and last item using [1:-1] is intuitive to me, but doing the same in reverse by doing [-2:0:-1] annoys me (though I do get why its like that). That is why I tend to do [1:-1][::-1] instead. More on reddit.com
๐ŸŒ r/Python
40
356
February 1, 2022
Beginner's Python cheat sheets - updated
very very nice, would be even nicer if the titles in the .pdf file would be searchable :) More on reddit.com
๐ŸŒ r/learnpython
52
447
August 16, 2016
๐ŸŒ
Scribd
scribd.com โ€บ document โ€บ 876376421 โ€บ Python-List-Slicing-Cheat-Sheet
Python List Slicing Cheat Sheet | PDF
This document is a cheat sheet for Python list slicing, detailing the syntax and various examples of how to slice lists. It covers basic slicing, omitting start or stop, using negative indices, and applying steps, including reversing lists.
๐ŸŒ
Blogger
peterhanshawart.blogspot.com โ€บ 2013 โ€บ 03 โ€บ sliced-py-cheat-sheet-for-python-slicing.html
Pete Hanshaw: Sliced Py- Cheat sheet for Python Slicing
foo = "Monty Python's Flying Circus" #Print the middle of foo- slice from the 7th-1 character end at the 15th-1 character print foo[6:14] #Use a slice to get the first six characters print foo[:6] #>>> Monty #Slice after the first six characters of foo print foo[6:] #>>> Python's Flying Circus #Print everthing in foo print foo[:] #>>> Monty Python's Flying Circus #Every second character print foo[0:27:2] #>>> MnyPto' ligCru #The last character of foo print foo[-1] #>>> s #The last two characters of foo print foo[-2:] #>>> us #Everything but the last seven charachers of foo print foo[:-7] #>>> Monty Python's Flying
๐ŸŒ
Scribd
scribd.com โ€บ document โ€บ 931764162 โ€บ Python-Slicing-Cheat-Sheet
Python Slicing Cheat Sheet | PDF
This document provides a cheat sheet for Python slicing, detailing common slicing syntax and their purposes. It includes examples demonstrating how to slice strings in various ways, such as extracting specific indices, reversing strings, and ...
๐ŸŒ
Python Cheatsheet
pythoncheatsheet.org โ€บ home โ€บ builtin โ€บ slice
Python slice() built-in function - Python Cheatsheet
Return a slice object representing the set of indices specified by range(start, stop, step). The start and step arguments default to None. Slice objects have read-only data attributes start, stop, and step which merely return the argument values ...
๐ŸŒ
Reddit
reddit.com โ€บ r/python โ€บ a comprehensive guide to slicing in python
r/Python on Reddit: A Comprehensive Guide to Slicing in Python
February 1, 2022 - 356 votes, 40 comments. Python Slicing is a powerful tool to access sequences. To learn more about the inner mechanics of slices, read this post ;)
๐ŸŒ
DEV Community
dev.to โ€บ vbd โ€บ comment โ€บ b110
A great Cheat sheet to slice a list in Python can be found here: linkedin.com... - DEV Community
May 20, 2019 - A great Cheat sheet to slice a list in Python can be found here: linkedin.com/pulse/cheat-sheet-pyt...
Find elsewhere
๐ŸŒ
Scribd
scribd.com โ€บ document โ€บ 455846510 โ€บ PythonForDataScience
Python For Data Science Cheat Sheet: Subset Slice | PDF | Array Data Type | Array Data Structure
This document provides a cheat sheet on Python for data science. It covers variables and data types, lists, Numpy arrays, strings, and common operations for each. Lists and arrays can be indexed, sliced, and their elements selected. Common list methods include append, remove, reverse, and sort.
Rating: 3 โ€‹ - โ€‹ 2 votes
๐ŸŒ
Codecademy
codecademy.com โ€บ learn โ€บ learn-python-3 โ€บ modules โ€บ learn-python3-lists โ€บ cheatsheet
Learn Python 3: Lists Cheatsheet | Codecademy
When slicing a list, a new list is returned, so if the slice is saved and then altered, the original list remains the same. ... The Python sorted() function accepts a list as an argument, and will return a new, sorted list containing the same ...
๐ŸŒ
k0nze
k0nze.dev โ€บ posts โ€บ python-lists
Python Course #8: Lists, List Slicing, and all List Functions (incl. Free Cheat Sheet) | k0nze
January 30, 2024 - Home Python Course #8: Lists, List Slicing, and all List Functions (incl. Free Cheat Sheet)
๐ŸŒ
Real Python
realpython.com โ€บ cheatsheets โ€บ python
Python Cheat Sheet โ€“ Real Python
text = "Python" text[0] # "P" (first) text[-1] # "n" (last) text[1:4] # "yth" (slice) text[:3] # "Pyt" (from start) text[3:] # "hon" (to end) text[::2] # "Pto" (every 2nd) text[::-1] # "nohtyP" (reverse)
๐ŸŒ
PyTutorial
pytutorial.com โ€บ python-array-slicing-a-complete-guide
PyTutorial | Python Array Slicing: A Complete Guide
March 25, 2026 - Master Python array slicing with this beginner-friendly guide covering syntax, examples, and practical use cases for efficient data manipulation.
๐ŸŒ
ScholarHat
scholarhat.com โ€บ home
What is Slicing in Python?
September 11, 2025 - The step option allows you to skip entries, change the order, or choose elements at precise intervals. my_list = [10, 20, 30, 40, 50, 60, 70, 80, 90, 100] # Example 1: Skipping Elements sliced_list = my_list[1:8:3] print(sliced_list)
๐ŸŒ
Medium
medium.com โ€บ @hariprakashh174 โ€บ mastering-slicing-in-python-a-beginners-guide-b87e742f57ff
Mastering Slicing in Python: A Beginnerโ€™s Guide | by HARIPRAKASH K | Medium
August 21, 2025 - # A sequence (list of numbers) numbers = [10, 20, 30, 40, 50, 60] # Slice from index 1 to 4 (stop is exclusive) result = numbers[1:4] print(result) #output [20, 30, 40] ๐Ÿ‘‰ Here, start = 1 (20) and stop = 4 (excludes index 4 โ†’ 50).
๐ŸŒ
ShortcutFoo
shortcutfoo.com โ€บ app โ€บ dojos โ€บ python-strings โ€บ cheatsheet
Python Strings Cheat Sheet | ShortcutFoo
Python Strings Cheatsheet ยท Start learning for free ยท ShortcutFoo uses a Spaced Repetition System that adapts to your training.
๐ŸŒ
Python Cheat Sheet
pythoncheatsheet.org
Python Cheat Sheet โ€“ Python Basics for Beginners
Python Cheat Sheet is now part of LabEx! Now featuring interactive labs, PDF downloads, built-in functions module, quiz questions, and multi-language support (๐Ÿ‡จ๐Ÿ‡ณ ๐Ÿ‡ฏ๐Ÿ‡ต ๐Ÿ‡ช๐Ÿ‡ธ ๐Ÿ‡ฉ๐Ÿ‡ช ๐Ÿ‡ซ๐Ÿ‡ท ๐Ÿ‡ต๐Ÿ‡น ๐Ÿ‡ฐ๐Ÿ‡ท ๐Ÿ‡ท๐Ÿ‡บ), while remaining open-source and free as always. Anyone can forget how to make character classes for a regex, slice a list or do a for loop .
๐ŸŒ
GeeksforGeeks
geeksforgeeks.org โ€บ python-list-slicing
Python List Slicing - GeeksforGeeks
Explanation: The negative step (-1) indicates that Python should traverse the list in reverse order, starting from the end. The slice a[::-1] starts from the end of the list and moves to the beginning which result in reversing list.
Published: March 8, 2025
๐ŸŒ
Medium
medium.com โ€บ @saadamir1 โ€บ python-slicing-the-complete-guide-with-edge-cases-youre-missing-07e171fb3743
Python Slicing: The Complete Guide (With Edge Cases Youโ€™re Missing) | by Saad Amir | Medium
December 10, 2025 - โœ… stop is always exclusive โœ… Negative indices count from the end โœ… Omitted values have smart defaults โœ… Negative step reverses direction and logic โœ… Out-of-bounds slices don't raise errors (be careful!) โœ… Slicing creates new objects (shallow copies) ... Try it yourself before running the code! Master slicing? Check out my article on recursion where we use slicing to reverse strings: Master Recursion Once and For All โ†’ ยท Found this helpful? Follow for more Python deep dives that clarify confusing concepts.