Python 3.2 (r32:88445, Feb 20 2011, 21:29:02) [MSC v.1500 32 bit (Intel)] on win32 Type "copyright", "credits" or "license()" for more information. >>> ================================ RESTART ================================ >>> >>> convert_base(9,2) '1001' >>> convert_base(9,3) '100' >>> convert_base(9,16) '9' >>> convert_base(17,16) '11' >>> convert_base(11,16) '11' >>> ================================ RESTART ================================ >>> >>> convert_base(11,16) 'b11' >>> ================================ RESTART ================================ >>> >>> convert_base(11,16) 'b' >>> ================================ RESTART ================================ >>> >>> convert_base(11,17) Traceback (most recent call last): File "", line 1, in convert_base(11,17) File "C:\Documents and Settings\eladlibm\Desktop\T3\convert_base_skeleton.py", line 7, in convert_base assert 2<=b<=16 AssertionError >>> ================================ RESTART ================================ >>> >>> convert_base(45,10) '45' >>> convert_base(-45,10) '-45' >>> convert_base(-45,2) '-101101' >>> convert_base(45,2) '101101' >>> convert_base(0,2) '0' >>> Python 3.3.0 (v3.3.0:bd8afb90ebf2, Sep 29 2012, 10:55:48) [MSC v.1600 32 bit (Intel)] on win32 Type "copyright", "credits" or "license()" for more information. >>> def f1(n): num=999 >>> n=5 >>> f1(n) >>> n): n=999 SyntaxError: invalid syntax >>> def f1(n): n=999 >>> n=5 >>> f1(n) >>> n 5 # n unchanged >>> def f2(lst): lst[1] = 999 >>> lst = [1,2,3] >>> f2(lst) >>> lst [1, 999, 3] # list changed! >>> def f3(lst): lst = [6,7,8] >>> lst [1, 999, 3] >>> f3(lst) >>> lst [1, 999, 3] # list unchanged... hah? >>>