What is the reason that the range(start, end) function in Python does not include the end value?

I’m new to Python, and I was working with the range() function, and I noticed that when I use range(start, end), it doesn’t include the end value in the resulting range. I was wondering why this is the case. I’ve tried looking up the Python documentation and various tutorials, but I’m still a bit confused.

Here’s an example of the code I’m using:

As you can see, 4 is not included in the output. Can anyone explain why this is the case? Is there a way to include the end value in the resulting range?

Any help would be greatly appreciated. Thank you!