
PRO
Keshava
asked

Expert
Kelish Rai answered
When you do range(1, 7)
, it gives you numbers starting from 1
up to but not including 7
. So it stops at 6
.
It’s not about indexing exactly — that’s just how range()
works in Python. The second number is treated as the "stop point", and it’s excluded from the result.
Let me know if you need more explanation on this. I'm happy to help.
Python
This question was asked as part of the Learn Python Basics course.