Notes from Wed May 13 Things we know so far: a) we know how to start IDLE b) we know how to enter numeric expressions c) we understand operators like: +, -, *, /, % and (, ) d) the order of evaluation is left to right for operators that have the same level of precedence (priority). Otherwise in the absence of parens the operators of higher priority will act first. e) in a numeric expression if one of the operands is a floating point number (has fractional part) the result is also a floating point number. Otherwise the result is an integer. http://www.libraries.iub.edu/scripts/countResources.php?resourceId=59555 We're here to learn how to program. Programming means: a) solve a problem (mysterious) b) express the solution in some foreign language (python) We don't know how to write a program yet. We know how to start IDLE. But we have to open a new window, write the program and save it. The extension of the program file should .py you can name it anything you want. (File --> New window --> save as .py) To start/run a program in Python you have two options: a) if you're developing it with IDLE press F5 This is the preferred method for debugging purposes. b) production environment: double-click on the icon. Then we wrote this to check on two things: a) see how a non-trivial Python program looks b) verify that we can run it in the same way We also discussed the role of raw_input(...) in keeping the window open. import random names = [ "lsabetti", "nfuriate", "dgerman", "mbrandal", "mlucero", "ckumar", "rcchu", "maengs", "cheungw", "dubeasle", "lawatkin", "dlajeune", "wuyi", "hugheshv", "hiukwan", "henlin", "jinh", "kakrieg", "rdaddari", "mykwak"] for num in range(10): print names[random.randrange(len(names))] raw_input("Press something to move on...")