(python3.6.1)
>>> a = range(13) >>> a range(0, 13) >>> list(a) [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12] >>> a[12] 12 >>> a[13] Traceback (most recent call last): File "/usr/local/Cellar/python3/3.6.1/Frameworks/Python.framework/Versions/3.6/lib/python3.6/code.py", line 91, in runcode exec(code, self.locals) File "<console>", line 1, in <module> IndexError: range object index out of range >>> len(a) > 12 True >>> len(a) > 13 False
シュガーシンタックス的なメソッドみたいなの無いのかな?