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. >>> n SyntaxError: unexpected indent >>> s = "I need a latte badly" >>> len(s) 20 >>> s[0] 'I' >>> s[19] 'y' >>> s[-1] 'y' >>> s[1:5] ' nee' >>> s[3:4] 'e' >>> s[4:5] 'e' >>> s[5:6] 'd' >>> s[5:5] '' >>> t = "" >>> u = " " >>> s[:4] 'I ne' >>> s[4:] 'ed a latte badly' >>> s[:] 'I need a latte badly' >>> s[2:6] 'need' >>> s[9:15] 'latte ' >>> s[9:14] 'latte' >>> s[2:6] + s[9:14] 'needlatte' >>> s[2:6] + " " + s[9:14] 'need latte' >>> s[2:6] 'need' >>> 5*s[2:6] 'needneedneedneedneed' >>> t = s[2:6] >>> t 'need' >>> t.upper() 'NEED' >>> u = t.upper() >>> u 'NEED' >>> v = u.lower() >>> v 'need' >>> s 'I need a latte badly' >>> s.count("e") 3 >>> s.count("a") 3 >>> s.count("i") 0 >>> len("abcdefghijklmnopqrstuvwxyz") 26 >>> =========== RESTART: /Users/koc/Desktop/enc.py =========== >>> letter2index("a") 0 >>> letter2index("b") 1 >>> letter2index("w") 22 >>> =========== RESTART: /Users/koc/Desktop/enc.py =========== >>> index2letter(22) 'w' >>> index2letter(4) 'e' >>> 29 % 26 3 >>> 456 % 26 14 >>> =========== RESTART: /Users/koc/Desktop/enc.py =========== >>> caesar("attack at down") Traceback (most recent call last): File "", line 1, in caesar("attack at down") File "/Users/koc/Desktop/enc.py", line 17, in caesar encm = (m + 3) % 26 TypeError: unsupported operand type(s) for +: 'NoneType' and 'int' >>> letter2index("b") 1 >>> index2letter(4) 'e' >>> =========== RESTART: /Users/koc/Desktop/enc.py =========== >>> caesar("attack at down") Traceback (most recent call last): File "", line 1, in caesar("attack at down") File "/Users/koc/Desktop/enc.py", line 17, in caesar encm = (m + 3) % 26 TypeError: unsupported operand type(s) for +: 'NoneType' and 'int' >>> u = "attack at down" >>> u 'attack at down' >>> caesar(u) Traceback (most recent call last): File "", line 1, in caesar(u) File "/Users/koc/Desktop/enc.py", line 17, in caesar encm = (m + 3) % 26 TypeError: unsupported operand type(s) for +: 'NoneType' and 'int' >>> =========== RESTART: /Users/koc/Desktop/enc.py =========== >>> u = "attack at down" >>> caesar(u) a 0 3 d d t 19 22 w dw t 19 22 w dww a 0 3 d dwwd c 2 5 f dwwdf k 10 13 n dwwdfn None Traceback (most recent call last): File "", line 1, in caesar(u) File "/Users/koc/Desktop/enc.py", line 19, in caesar encm = (m + 3) % 26 TypeError: unsupported operand type(s) for +: 'NoneType' and 'int' >>> >>> u 'attack at down' >>> u = "attackatdown" >>> caesar(u) a 0 3 d d t 19 22 w dw t 19 22 w dww a 0 3 d dwwd c 2 5 f dwwdf k 10 13 n dwwdfn a 0 3 d dwwdfnd t 19 22 w dwwdfndw d 3 6 g dwwdfndwg o 14 17 r dwwdfndwgr w 22 25 z dwwdfndwgrz n 13 16 q dwwdfndwgrzq 'dwwdfndwgrzq' >>> =========== RESTART: /Users/koc/Desktop/enc.py =========== >>> u = "attackatdown" >>> caesar(u) 'dwwdfndwgrzq' >>> u = "attackatdawn" >>> caesar(u) 'dwwdfndwgdzq' >>> =========== RESTART: /Users/koc/Desktop/enc.py =========== >>> u = "attackatdawn" >>> caesar(u, 3) 'dwwdfndwgdzq' >>> caesar(u, 4) 'exxegoexhear' >>> caesar(u, 3) 'dwwdfndwgdzq' >>> caesar('dwwdfndwgdzq', -3) 'attackatdawn' >>> =========== RESTART: /Users/koc/Desktop/enc.py =========== >>> caesar("attack at dawn", 5) Traceback (most recent call last): File "", line 1, in caesar("attack at dawn", 5) File "/Users/koc/Desktop/enc.py", line 17, in caesar encm = (m + key) % 26 TypeError: unsupported operand type(s) for +: 'NoneType' and 'int' >>> =========== RESTART: /Users/koc/Desktop/enc.py =========== >>> caesar("attack at dawn", 7) 'haahjr ha khdu' >>> caesar("haahjr ha khdu", -7) 'attack at dawn' >>> encm = (m + key) % 26 Traceback (most recent call last): File "", line 1, in encm = (m + key) % 26 NameError: name 'm' is not defined >>> >>> >>> >>>