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 ================================ >>> >>> help(convert_base) Help on function convert_base in module __main__: convert_base(n, b) convert_base(integer, integer) -> string Return the textual representation of n (decimal) in base 2 <= b <= 10 >>> ================================ RESTART ================================ >>> >>> convert_base(10,2) '1010' 10> >>> convert_base(10,16) '10' >>> convert_base(-10,2) Traceback (most recent call last): File "", line 1, in convert_base(-10,2) File "C:\work\Python\03\new\convert_base_1.py", line 11, in convert_base result = str(digit) + result KeyboardInterrupt >>> convert_base(0,2) '' >>> ================================ RESTART ================================ >>> >>> convert_base(0,2) '0' >>> convert_base(10,2) '1010' >>> convert_base(10,16) 'a' >>> ================================ RESTART ================================ >>> 36 or b < 2 > >>> convert_base(10,100) Traceback (most recent call last): File "", line 1, in convert_base(10,100) File "C:/work/Python/03/new/convert_base_2.py", line 6, in convert_base assert 2 <= b <= 36 AssertionError >>> def change_int(n): n = 100 >>> a = 30 >>> a 30 >>> change_int(a) >>> a 30 >>> n = 30 >>> change_int(n) >>> n 30 >>> def add_to_list(lst): lst.append(999) >>> l = [1,2,3] >>> add_to_list(l) >>> l [1, 2, 3, 999] >>> def empty_list(lst): lst = [] >>> empty_list(l) >>> l [1, 2, 3, 999] >>> lst = [3,2,1] >>> lst [3, 2, 1] >>> hex(id(lst)) '0x328ca48' >>> id(lst) 53004872 >>> lst = lst + [0] >>> lst [3, 2, 1, 0] >>> hex(id(lst)) '0x321d408' >>> lst.append(40) >>> lst [3, 2, 1, 0, 40] >>> hex(id(lst)) '0x321d408' >>> lst.extend(["a","b"]) >>> lst [3, 2, 1, 0, 40, 'a', 'b'] >>> hex(id(lst)) '0x321d408' >>> lst += [8] >>> lst [3, 2, 1, 0, 40, 'a', 'b', 8] >>> hex(id(lst)) '0x321d408' >>>