Python 3.3.2 (v3.3.2:d047928ae3f6, May 16 2013, 00:06:53) [MSC v.1600 64 bit (AMD64)] on win32 Type "copyright", "credits" or "license()" for more information. >>> ================================ RESTART ================================ >>> >>> convert_base(4,37) Traceback (most recent call last): File "", line 1, in convert_base(4,37) File "F:\convert_base_skeleton.py", line 7, in convert_base assert 2<=b<=36 AssertionError >>> ================================ RESTART ================================ >>> >>> convert_base(22, 2) '10110' >>> convert_base(2, 2) '10' >>> convert_base(2956, 2) '101110001100' >>> bin(22) '0b10110' >>> hex(22) '0x16' >>> hex(25) '0x19' >>> hex(31) '0x1f' >>> ================================ RESTART ================================ >>> >>> convert_base(0, 2) '' >>> ================================ RESTART ================================ >>> >>> convert_base(0, 2) '0' >>> "0123456789abcdef"[0] '0' >>> "0123456789abcdef"[1] '1' >>> "0123456789abcdef"[11] 'b' >>> ================================ RESTART ================================ >>> >>> ================================ RESTART ================================ >>> >>> convert_base(22, 16) '16' >>> convert_base(10, 16) 'a' >>> convert_base(16, 16) '10' >>> int("a") Traceback (most recent call last): File "", line 1, in int("a") ValueError: invalid literal for int() with base 10: 'a' >>> int("a", 16) 10 >>> int("10110", 2) 22 >>> int(10110, 2) Traceback (most recent call last): File "", line 1, in int(10110, 2) TypeError: int() can't convert non-string with explicit base >>> int(0b10110, 2) Traceback (most recent call last): File "", line 1, in int(0b10110, 2) TypeError: int() can't convert non-string with explicit base >>> int(0b10110) 22 >>> def change_int(n): n = 999 >>> n = 1 >>> n 1 >>> change_int(n) >>> n 1 >>> change_list(L): SyntaxError: invalid syntax >>> def change_list(L): L.append(999) >>> lst = [1,2,3] >>> change_list(lst) >>> lst [1, 2, 3, 999] >>> def change_list2(L): L = [999,999] >>> L Traceback (most recent call last): File "", line 1, in L NameError: name 'L' is not defined >>> lst [1, 2, 3, 999] >>> change_list2(lst) >>> lst [1, 2, 3, 999] >>>