Created
August 1, 2019 09:25
-
-
Save niranjrajasekaran/f9d44bb0d3090400677cdbb6104fb134 to your computer and use it in GitHub Desktop.
This file contains 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
In [1]: l = [10, 'python-list', 1, 2, 3, 4, 5, [1, 2, 3, 4, 5]] | |
In [2]: l | |
Out[2]: [10, 'python-list', 1, 2, 3, 4, 5, [1, 2, 3, 4, 5]] | |
In [3]: l[0] | |
Out[3]: 10 | |
In [4]: l[1] | |
Out[4]: 'python-list' | |
In [5]: l[-1] | |
Out[5]: [1, 2, 3, 4, 5] | |
In [6]: l[100] | |
--------------------------------------------------------------------------- | |
IndexError Traceback (most recent call last) | |
<ipython-input-6-e2a0c2623844> in <module>() | |
----> 1 l[100] | |
IndexError: list index out of range |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment