|
|
|
|
|
by sago
3951 days ago
|
|
I've found this a helpful way of explaining ranges in Python to students, it also makes Python's negative indices understandable for the same reason. But it is contextual. When it comes to languages like C, where arrays are more directly mapped to pointers and memory layout, I've found it better to talk about pointers, and allow people to derive the behavior that way. Either way, I'd be careful of trying to claim that 'this is what it is', rather than 'here is a way to remember it'. |
|