Python 2.5.1 (r251:54863, Apr 18 2007, 08:51:08) [MSC v.1310 32 bit (Intel)] on win32 Type "copyright", "credits" or "license()" for more information. **************************************************************** Personal firewall software may warn about the connection IDLE makes to its subprocess using this computer's internal loopback interface. This connection is not visible on any external interface and no data is sent to or received from the Internet. **************************************************************** IDLE 1.2.1 >>> range(10) [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] >>> range(5) [0, 1, 2, 3, 4] >>> range(1) [0] >>> range(0) [] >>> range(-5) [] >>> range(3,9) [3, 4, 5, 6, 7, 8] >>> range(-8,2) [-8, -7, -6, -5, -4, -3, -2, -1, 0, 1] >>> range(5,-5) [] >>> range(5,5) [] >>> range(1,10,2) [1, 3, 5, 7, 9] >>> range(5,-5,-1) [5, 4, 3, 2, 1, 0, -1, -2, -3, -4] >>> range(5,-6,-1) [5, 4, 3, 2, 1, 0, -1, -2, -3, -4, -5] >>> ================================ RESTART ================================ >>> # This was a simple for loop. 0 1 2 3 4 5 6 7 8 9 >>> range(10) [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] >>> ================================ RESTART ================================ >>> # This was another simple for loop. hi! hi! hi! hi! hi! hi! hi! hi! hi! hi! >>> ================================ RESTART ================================ >>> # This was from a for loop with an error in it. Traceback (most recent call last): File "C:/Documents and Settings/bwalter.AC_COMPUTING/Desktop/CF W08/python programs/simplefor.py", line 5, in print i NameError: name 'i' is not defined >>> ================================ RESTART ================================ >>> # Another simple for loop. 0 1 2 3 4 5 6 7 8 9 >>> ================================ RESTART ================================ >>> # Yet another one. 0 1 2 3 4 5 6 7 8 9 9 >>> ================================ RESTART ================================ >>> # A simple for loop printing the squares - see simplefor.py. 0 1 4 9 16 25 36 49 64 81 >>> ================================ RESTART ================================ >>> # This is from running factorial.py. I feel so free to compute factorials for your utter delight. Please enter a nonnegative integer: 12 12! = 479001600. I feel special! Hit enter to exit. >>> import factorial I feel so free to compute factorials for your utter delight. Please enter a nonnegative integer: 3 3! = 6. I feel special! Hit enter to exit. >>> factorial.main() I feel so free to compute factorials for your utter delight. Please enter a nonnegative integer: 0 0! = 1. I feel special! Hit enter to exit. >>> factorial.main() I feel so free to compute factorials for your utter delight. Please enter a nonnegative integer: -3 -3! = 1. I feel special! Hit enter to exit. >>> ================================ RESTART ================================ >>> len(range(10)) 10 >>> name = "Brian" >>> name 'Brian' >>> name[1] 'r' >>> name[0] 'B' >>> name[5] Traceback (most recent call last): File "", line 1, in name[5] IndexError: string index out of range >>> name[100] Traceback (most recent call last): File "", line 1, in name[100] IndexError: string index out of range >>> name[-1] 'n' >>> name[-2] 'a' >>> name[-3] 'i' >>> name[-4] 'r' >>> name[-5] 'B' >>> name[-6] Traceback (most recent call last): File "", line 1, in name[-6] IndexError: string index out of range >>> ================================ RESTART ================================ >>> # This is from running redact.py. I'm in the mood to redact something! Please enter a string you'd like to clean up: My iPod only cost $5. w00t! Here's the version we'll show the press: My iPod only cost $X. wXXt! Hit enter to exit. >>> import redact I'm in the mood to redact something! Please enter a string you'd like to clean up: 3 Here's the version we'll show the press: X Hit enter to exit. >>>