Thread
Ever wondered why Slices and Range Exclude the last item in Python ?

Let's explore in today's thread 🧵
Before we begin a humble request to subscribe to my YouTube channel 🙏

youtu.be/q4M5PJDbO4U
{Consistency in number of items produced when only stop is given }

range(N) and list[:N] both produce N items
{ Easy to compute length of slice or range when start and stop are given }

Just subtract stop-start
{ Easy to split a sequence in two parts at any index N, without overlapping }
Hello 👋

I am Jaydeep From Pune, India 🇮🇳

Full time Software Engineer & Partime content creator on
🐦Twitter
🖧 Linkedin
🎥YouTube

Follow me @_jaydeepkarale for content on
🐍 Python
🤖Ai/ML
🎨Data Visualization
🌟Content creation
Mentions
See All