Created
November 11, 2016 23:37
-
-
Save johnsyweb/d1d60631cfe4d5e0001675d66d823b3b to your computer and use it in GitHub Desktop.
Python surprise!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
>>> l = [] | |
>>> l[100:] = ['foo'] | |
>>> l[100] | |
Traceback (most recent call last): | |
File "<stdin>", line 1, in <module> | |
IndexError: list index out of range |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
If you know the why Python behaves this way, you can earn some imaginary Internet points here:
http://stackoverflow.com/q/40558529/78845