Created
February 14, 2012 10:09
-
-
Save JakubOboza/1825484 to your computer and use it in GitHub Desktop.
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
Python 2.7.2 (default, Jan 23 2012, 23:13:33) | |
[GCC 4.2.1 Compatible Apple Clang 3.0 (tags/Apple/clang-211.10.1)] on darwin | |
Type "help", "copyright", "credits" or "license" for more information. | |
>>> ar = [1,2,3] | |
>>> ar | |
[1, 2, 3] | |
>>> ar[:-1] | |
[1, 2] | |
>>> ar[-1] | |
3 | |
>>> ar[-10] | |
Traceback (most recent call last): | |
File "<stdin>", line 1, in <module> | |
IndexError: list index out of range | |
>>> ar[-2] | |
2 | |
>>> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment