KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I understand that somelist[len(somelist)] cannot access an index that is outside of the defined list - this makes sense. But why then does Python allow you to do somelist[len(somelist):] ? I've even read that somelist[len(somelist):] = [1] is equivalent to somelist.append(1) But why does slice notation change the fact that the index "len(somelist)" is still outside the range of the list?
Tags (comma-separated)
Save Edits
Cancel