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(56,1) Traceback (most recent call last): File "", line 1, in convert_base(56,1) File "F:\convert_base_skeleton.py", line 7, in convert_base assert 2<=b<=36 AssertionError >>> ================================ RESTART ================================ >>> >>> convert_base(22,2) '10110' >>> convert_base(23,2) '10111' >>> convert_base(1984,10) '1984' >>> convert_base(30,16) Traceback (most recent call last): File "", line 1, in convert_base(30,16) File "F:\convert_base_skeleton.py", line 7, in convert_base assert 2<=b<=10 AssertionError >>> convert_base(30,7) '42' >>> ================================ RESTART ================================ >>> >>> convert_base(0,7) '' >>> ================================ RESTART ================================ >>> >>> convert_base(0,7) '0' >>> "0123456789abcdef"[3] '3' >>> ================================ RESTART ================================ >>> >>> ================================ RESTART ================================ >>> >>> convert_base(30,16) '1e' >>> bin(22) '0b10110' >>> bin(22)[2:] '10110' >>> hex(30) '0x1e' >>> int("1e", 16) 30 >>> int("10110", 2) 22 >>> int("1e", 11) Traceback (most recent call last): File "", line 1, in int("1e", 11) ValueError: invalid literal for int() with base 11: '1e' >>> int("a") Traceback (most recent call last): File "", line 1, in int("a") ValueError: invalid literal for int() with base 10: 'a' >>> 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. >>> def change_num(n): n= 999 >>> n = 1 >>> n 1 >>> change_num(n) >>> n 1 >>> def change_num(n): n= 999 return n >>> n 1 >>> change_num(n) 999 >>> n 1 >>> change_list(L): SyntaxError: invalid syntax >>> def change_list(L): L.append(999) >>> L = [1,2,3] >>> change_list(L) >>> L [1, 2, 3, 999] >>> def change_list2(L): L = [] >>> L [1, 2, 3, 999] >>> change_list2(L) >>> L [1, 2, 3, 999] >>> lst = [3,2,1] >>> id(x) Traceback (most recent call last): File "", line 1, in id(x) NameError: name 'x' is not defined >>> id(lst) 54273864 >>> lst = lst + [0] >>> id(lst) 55560072 >>> lst.append(5) >>> lst [3, 2, 1, 0, 5] >>> id(lst) 55560072 >>> lst += [0] >>> lst [3, 2, 1, 0, 5, 0] >>> id(lst) 55560072 >>>