Python 3.7.0 (v3.7.0:1bf9cc5093, Jun 26 2018, 23:26:24) [Clang 6.0 (clang-600.0.57)] on darwin Type "copyright", "credits" or "license()" for more information. >>> a = [] >>> a [] >>> b = [1] >>> b [1] >>> c = [2, 1] >>> c [2, 1] >>> b[0] 1 >>> b[1] Traceback (most recent call last): File "", line 1, in b[1] IndexError: list index out of range >>> c[1] 1 >>> c[2] Traceback (most recent call last): File "", line 1, in c[2] IndexError: list index out of range >>> a[0] Traceback (most recent call last): File "", line 1, in a[0] IndexError: list index out of range >>> s = "Hello" >>> for i in range(5): print(s[i]) H e l l o >>> for c in s: print(c) H e l l o >>> c 'o' >>> a = [23, 32, 34, 45, 65, 66, 67, 99] >>> a [23, 32, 34, 45, 65, 66, 67, 99] >>> for i in range(len(a)): print(a[i],end="**") 23**32**34**45**65**66**67**99** >>> for x in a: print(x,end="**") 23**32**34**45**65**66**67**99** >>> a [23, 32, 34, 45, 65, 66, 67, 99] >>> len(a) 8 >>> a[8] Traceback (most recent call last): File "", line 1, in a[8] IndexError: list index out of range >>> a [23, 32, 34, 45, 65, 66, 67, 99] >>> a.append(100) >>> a [23, 32, 34, 45, 65, 66, 67, 99, 100] >>> a.insert(2,1000) >>> a [23, 32, 1000, 34, 45, 65, 66, 67, 99, 100] >>> 34 in a True >>> 33 in a False >>> a.index(67) 7 >>> a.pop(99) Traceback (most recent call last): File "", line 1, in a.pop(99) IndexError: pop index out of range >>> a [23, 32, 1000, 34, 45, 65, 66, 67, 99, 100] >>> a.pop(0) 23 >>> a [32, 1000, 34, 45, 65, 66, 67, 99, 100] >>> len(a) 9 >>> a.pop(8) 100 >>> a [32, 1000, 34, 45, 65, 66, 67, 99] >>> a [32, 1000, 34, 45, 65, 66, 67, 99] >>> sum(a) 1408 >>> b = ["Cat", "dog", 99] >>> sum(b) Traceback (most recent call last): File "", line 1, in sum(b) TypeError: unsupported operand type(s) for +: 'int' and 'str' >>> max(a) 1000 >>> a [32, 1000, 34, 45, 65, 66, 67, 99] >>> min(a) 32 >>> a [32, 1000, 34, 45, 65, 66, 67, 99] >>> a.sort() >>> a [32, 34, 45, 65, 66, 67, 99, 1000] >>>