Python 3.4.1 (v3.4.1:c0e311e010fc, May 18 2014, 10:38:22) [MSC v.1600 32 bit (Intel)] on win32 Type "copyright", "credits" or "license()" for more information. >>> val1 = 65 >>> isinstance(val1, int) True >>> isinstance(val1, float) False >>> val2 = 65.0 >>> isinstance(val2, float) True >>> isinstance(val2, int) False >>> type(val2) >>> type(val2) == float True >>> type(val2) == int False >>> isinstance(val2, (int, float)) True >>> instance(val1, (int, float)) Traceback (most recent call last): File "", line 1, in instance(val1, (int, float)) NameError: name 'instance' is not defined >>> isinstance(val1, (int, float)) True >>> ================================ RESTART ================================ >>> a val: b Traceback (most recent call last): File "C:/Users/mil28/Desktop/review15.py", line 7, in print_value('b') File "C:/Users/mil28/Desktop/review15.py", line 3, in print_value raise ValueError ValueError >>> ================================ RESTART ================================ >>> a val: b d c >>> ================================ RESTART ================================ >>> a val: b e c >>> ================================ RESTART ================================ >>> a Please enter something: a val: a Bad value entered Please enter something: b val: b Exception raised c >>> ================================ RESTART ================================ >>> Please enter a positive integer: 5 The factorial is: 120 >>> factorial.__doc__ '\n (int) -> int\n \n Computes the factorial of the number provided.\n\n num is the integer to get the factorial of. It must be a positive integer.\n Raises TypeError if num is not an int.\n Raises ValueError if num is not positive.\n\n Returns an int representing the factorial of the number passed in.\n ' >>> print(factorial.__doc__) (int) -> int Computes the factorial of the number provided. num is the integer to get the factorial of. It must be a positive integer. Raises TypeError if num is not an int. Raises ValueError if num is not positive. Returns an int representing the factorial of the number passed in. >>> help(factorial) Help on function factorial in module __main__: factorial(num) (int) -> int Computes the factorial of the number provided. num is the integer to get the factorial of. It must be a positive integer. Raises TypeError if num is not an int. Raises ValueError if num is not positive. Returns an int representing the factorial of the number passed in. >>> ================================ RESTART ================================ >>> Please enter a positive integer: 5 The factorial is: 120 >>> help(factorial) Help on function factorial in module __main__: factorial(num) (int) -> int Computes the factorial of the number provided. num is the integer to get the factorial of. It must be a positive integer. Raises TypeError if num is not an int. Raises ValueError if num is not positive. Returns an int representing the factorial of the number passed in. >>> ================================ RESTART ================================ >>> Please enter a positive integer: 5 The factorial is: 120 >>> help(factorial) Help on function factorial in module __main__: factorial(num) >>> ================================ RESTART ================================ >>> >>> ================================ RESTART ================================ >>> Hello, Joel! >>> ================================ RESTART ================================ >>> Hello, Joel! Hi, Michael! >>> import sys >>> sys.path ['C:/Users/mil28/Desktop', 'C:\\Python34\\Lib\\idlelib', 'C:\\Windows\\SYSTEM32\\python34.zip', 'C:\\Python34\\DLLs', 'C:\\Python34\\lib', 'C:\\Python34', 'C:\\Python34\\lib\\site-packages'] >>> import errormodule Traceback (most recent call last): File "", line 1, in import errormodule ImportError: No module named 'errormodule' >>> ================================ RESTART ================================ >>> Traceback (most recent call last): File "C:/Users/mil28/Desktop/module_ex.py", line 1, in import greetings ImportError: No module named 'greetings' >>> import os >>> os.getcwd() 'C:\\Users\\mil28\\Desktop' >>> os.chdir('C:\\Users\\mil28\\Documents\\python') >>> import greetings Traceback (most recent call last): File "", line 1, in import greetings ImportError: No module named 'greetings' >>> sys.path Traceback (most recent call last): File "", line 1, in sys.path NameError: name 'sys' is not defined >>> import sys >>> sys.path ['C:/Users/mil28/Desktop', 'C:\\Python34\\Lib\\idlelib', 'C:\\Windows\\SYSTEM32\\python34.zip', 'C:\\Python34\\DLLs', 'C:\\Python34\\lib', 'C:\\Python34', 'C:\\Python34\\lib\\site-packages'] >>> sys.path.append('C:\\Users\\mil28\\Documents\\python') >>> sys.path ['C:/Users/mil28/Desktop', 'C:\\Python34\\Lib\\idlelib', 'C:\\Windows\\SYSTEM32\\python34.zip', 'C:\\Python34\\DLLs', 'C:\\Python34\\lib', 'C:\\Python34', 'C:\\Python34\\lib\\site-packages', 'C:\\Users\\mil28\\Documents\\python'] >>> import greetings >>> greetings.greet_user('Michael') Hello, Michael! >>> ================================ RESTART ================================ >>> Hello, Joel! Hi, Michael! >>> sys.path ['C:/Users/mil28/Desktop', 'C:\\Python34\\Lib\\idlelib', 'C:\\Windows\\SYSTEM32\\python34.zip', 'C:\\Python34\\DLLs', 'C:\\Python34\\lib', 'C:\\Python34', 'C:\\Python34\\lib\\site-packages', 'C:\\Users\\mil28\\Documents\\python'] >>> sys.path.insert(0, '') >>> sys.path ['', 'C:/Users/mil28/Desktop', 'C:\\Python34\\Lib\\idlelib', 'C:\\Windows\\SYSTEM32\\python34.zip', 'C:\\Python34\\DLLs', 'C:\\Python34\\lib', 'C:\\Python34', 'C:\\Python34\\lib\\site-packages', 'C:\\Users\\mil28\\Documents\\python'] >>> import os >>> os.chdir('C:\\Users\\mil28\\Documents\\python') >>> import greetings >>> ================================ RESTART ================================ >>> >>> ================================ RESTART ================================ >>> Hello, Joel! Hi, Michael! >>> help(greetings) Help on module greetings: NAME greetings FUNCTIONS greet_user(name) greet_user2(greeting, name) FILE c:\users\mil28\documents\python\greetings.py >>>