Hi 👋, I'm a software engineer (backend, applied AI, Elastic Stack). My blog shares practical tutorials, mostly on the Elastic Stack and Next.js. LeetCode 1756 (top 10.4% globally, Sep 2026). Actively seeking SDE roles — let's get in touch!
Comments
Leave a Comment
Success!
Receive Latest Updates 📬
Get every new post, special offers, and more via email. No fee required.
You may see some code in Python like list[-1], list[:n], list[-n:], or list[::-1]. What do they mean? In this article, we will learn more about this technique which is called list slicing.
In simple words, the meaning of those expressions is:
list[-1]: get the last element of the list
list[:n]: get the first n elements of the list
list[-n:]: get the last n elements of the list
list[::-1]: reverse the list
Keep reading to understand more how list slicing works.
Comments