Python 3.1.2 (r312:79360M, Mar 24 2010, 01:33:18) [GCC 4.0.1 (Apple Inc. build 5493)] on darwin Type "copyright", "credits" or "license()" for more information. >>> ================================ RESTART ================================ >>> >>> question2() E+s+t+a+b+l+i+s+h+m+e+n+t >>> question3() My choice is Pat's Petunias: 333-434-5500 >>> import re >>> re.search('[DdBb]og','There is a dog') <_sre.SRE_Match object at 0x15becd0> >>> re.search('[^DdBb]og','There is a dog') >>> re.search('[^DdBb]og','There is a log') <_sre.SRE_Match object at 0x15bec98> >>> re.search('[d-m]og','There is a log') <_sre.SRE_Match object at 0x15becd0> >>> re.search('^[d-m]og','There is a log') >>> re.search('^[d-m]og','Dog dog is on a log') >>> re.search('^[D-Md-m]og','Dog dog is on a log') <_sre.SRE_Match object at 0x15bec98> >>> re.search('^[D-M,d-m]og','Dog dog is on a log') <_sre.SRE_Match object at 0x15becd0> >>> re.search('^[D-M,d-m]og',',og ,og is on a log') <_sre.SRE_Match object at 0x15bec98> >>> re.search('^[D-M$d-m]og','$og ,og is on a log') <_sre.SRE_Match object at 0x15becd0> >>> question4() {'John Lennon': 'Reality leaves a lot to the imagination', 'Richard Nixon': 'I am not a crook', 'Benjamin Franklin': 'A penny saved is a penny earned', 'George W. Bush': 'I know the human being and fish can coexist peacefully', 'Ralph Nader': 'The function of leadership is to produce more leaders, not more followers'} >>> quotation_dictionary['John Lennon'] 'Reality leaves a lot to the imagination' >>> question5() fixed touched spilled patted finded told haved tried >>> ================================ RESTART ================================ >>> >>> question7() >>> my_turtle.home() >>> my_turtle.clear() >>> question7() >>> my_turtle.home() >>> my_turtle.clear() >>> regular_shape(4,100) >>> my_turtle.fd(200) >>> my_turtle.home() >>> my_turtle.clear() >>> super_regular_shape(3,100) >>> my_turtle.home() >>> my_turtle.clear() >>> super_regular_shape(5,60) >>> my_turtle.home() >>> my_turtle.clear() >>> super_regular_shape(10,40) >>> ================================ RESTART ================================ >>> >>> my_mad_lib() Please enter a Person Name: Cheney Please enter a noun: gun Please enter a noun: friend Please enter a adjective: bloody Please enter a liquid or powder: beer Cheney had a little gun little gun little gun Cheney had a little gun little gun little gun whose friend was bloody as beer >>> ================================ RESTART ================================ >>> Traceback (most recent call last): File "/Users/adam/Desktop/Summer 2011 Scripts/recursion-functions.py", line 187, in read_in_relations('british-royal.txt') File "/Users/adam/Desktop/Summer 2011 Scripts/recursion-functions.py", line 183, in read_in_relations with open(infile, 'r') as instream: IOError: [Errno 2] No such file or directory: 'british-royal.txt' >>> ================================ RESTART ================================ >>> >>> recursive_count(10) Counting to 10 Counting to 9 Counting to 8 Counting to 7 Counting to 6 Counting to 5 Counting to 4 Counting to 3 Counting to 2 Counting to 1 1 2 3 4 5 6 7 8 9 10 >>> iterative_count(10) At item: 1 1 At item: 2 2 At item: 3 3 At item: 4 4 At item: 5 5 At item: 6 6 At item: 7 7 At item: 8 8 At item: 9 9 At item: 10 10 >>> recursive_count_down(10) Counting down from 10 10 Counting down from 9 9 Counting down from 8 8 Counting down from 7 7 Counting down from 6 6 Counting down from 5 5 Counting down from 4 4 Counting down from 3 3 Counting down from 2 2 Counting down from 1 1 >>> iterative_count_down(10) Note: num_so_far is 0 10 Note: num_so_far is 1 9 Note: num_so_far is 2 8 Note: num_so_far is 3 7 Note: num_so_far is 4 6 Note: num_so_far is 5 5 Note: num_so_far is 6 4 Note: num_so_far is 7 3 Note: num_so_far is 8 2 Note: num_so_far is 9 1 >>> recursive_factorial(5) Starting factorial for 5 Starting factorial for 4 Starting factorial for 3 Starting factorial for 2 Starting factorial for 1 Starting factorial for 0 factorial for 0 is 1 Number 1 So far 1 Number 2 So far 2 Number 3 So far 6 Number 4 So far 24 Number 5 So far 120 120 >>> iterative_factorial(5) Num 1 so_far 1 Num 2 so_far 2 Num 3 so_far 6 Num 4 so_far 24 Num 5 so_far 120 120 >>> endless_iterative_timer() 1 2 3 4 Traceback (most recent call last): File "", line 1, in endless_iterative_timer() File "/Users/adam/Desktop/Summer 2011 Scripts/recursion-functions.py", line 104, in endless_iterative_timer time.sleep(1) KeyboardInterrupt >>> endless_recursive_timer() 1 2 3 4 5 Traceback (most recent call last): File "", line 1, in endless_recursive_timer() File "/Users/adam/Desktop/Summer 2011 Scripts/recursion-functions.py", line 99, in endless_recursive_timer endless_recursive_timer(start=newstart) File "/Users/adam/Desktop/Summer 2011 Scripts/recursion-functions.py", line 99, in endless_recursive_timer endless_recursive_timer(start=newstart) File "/Users/adam/Desktop/Summer 2011 Scripts/recursion-functions.py", line 99, in endless_recursive_timer endless_recursive_timer(start=newstart) File "/Users/adam/Desktop/Summer 2011 Scripts/recursion-functions.py", line 99, in endless_recursive_timer endless_recursive_timer(start=newstart) File "/Users/adam/Desktop/Summer 2011 Scripts/recursion-functions.py", line 99, in endless_recursive_timer endless_recursive_timer(start=newstart) File "/Users/adam/Desktop/Summer 2011 Scripts/recursion-functions.py", line 96, in endless_recursive_timer time.sleep(1) KeyboardInterrupt >>> def guess_five(): guess = input('What number? ') if guess == '5': print('You win') else: guess_five() >>> guess_five() What number? 57 What number? 100 What number? 35 What number? 5 You win >>> 1000 * ((1 + (.1/360)) ** 360) 1105.1555714280607 >>> ================================ RESTART ================================ >>> >>> compute_compound_interest(1000,.1/360,360) >>> ================================ RESTART ================================ >>> >>> compute_compound_interest(1000,.1/360,360) 1105.1555714280441 >>> ================================ RESTART ================================ >>> >>> compute_compound_interest2(1000,.1/360,360) >>> ================================ RESTART ================================ >>> >>> compute_compound_interest2(1000,.1/360,360) 1000.27777778 >>> ================================ RESTART ================================ >>> >>> compute_compound_interest2(1000,.1/360,360) 1000.27777778 >>> ================================ RESTART ================================ >>> >>> compute_compound_interest2(1000,.1/360,360) 1000.27777778 1000.55563272 1000.83356484 1001.11157416 1001.38966071 1001.6678245 1001.94606557 1002.22438392 1002.50277958 1002.78125257 1003.05980292 1003.33843064 1003.61713576 1003.8959183 1004.17477828 1004.45371572 1004.73273064 1005.01182306 1005.29099301 1005.57024051 1005.84956558 1006.12896824 1006.40844851 1006.68800641 1006.96764196 1007.2473552 1007.52714613 1007.80701478 1008.08696118 1008.36698533 1008.64708727 1008.92726702 1009.20752459 1009.48786002 1009.76827331 1010.0487645 1010.3293336 1010.60998064 1010.89070563 1011.1715086 1011.45238958 1011.73334858 1012.01438562 1012.29550072 1012.57669392 1012.85796522 1013.13931466 1013.42074224 1013.70224801 1013.98383196 1014.26549414 1014.54723456 1014.82905323 1015.11095019 1015.39292545 1015.67497904 1015.95711098 1016.23932129 1016.52160999 1016.80397711 1017.08642266 1017.36894666 1017.65154915 1017.93423013 1018.21698964 1018.49982769 1018.78274431 1019.06573952 1019.34881334 1019.63196578 1019.91519689 1020.19850666 1020.48189514 1020.76536233 1021.04890826 1021.33253296 1021.61623644 1021.90001873 1022.18387985 1022.46781981 1022.75183865 1023.03593638 1023.32011303 1023.60436862 1023.88870317 1024.1731167 1024.45760923 1024.74218079 1025.02683139 1025.31156107 1025.59636983 1025.88125772 1026.16622473 1026.4512709 1026.73639626 1027.02160081 1027.30688459 1027.59224761 1027.8776899 1028.16321149 1028.44881238 1028.7344926 1029.02025218 1029.30609114 1029.5920095 1029.87800728 1030.16408451 1030.4502412 1030.73647737 1031.02279306 1031.30918828 1031.59566306 1031.88221741 1032.16885136 1032.45556493 1032.74235814 1033.02923102 1033.31618358 1033.60321586 1033.89032786 1034.17751962 1034.46479115 1034.75214248 1035.03957363 1035.32708462 1035.61467548 1035.90234622 1036.19009688 1036.47792746 1036.76583799 1037.0538285 1037.34189901 1037.63004954 1037.91828011 1038.20659074 1038.49498146 1038.78345229 1039.07200325 1039.36063436 1039.64934565 1039.93813713 1040.22700884 1040.51596079 1040.804993 1041.09410549 1041.3832983 1041.67257144 1041.96192493 1042.2513588 1042.54087307 1042.83046775 1043.12014288 1043.40989848 1043.69973456 1043.98965115 1044.27964828 1044.56972596 1044.85988422 1045.15012307 1045.44044255 1045.73084268 1046.02132347 1046.31188494 1046.60252713 1046.89325006 1047.18405374 1047.4749382 1047.76590346 1048.05694954 1048.34807647 1048.63928427 1048.93057296 1049.22194257 1049.51339311 1049.8049246 1050.09653708 1050.38823057 1050.68000507 1050.97186063 1051.26379726 1051.55581498 1051.84791382 1052.14009379 1052.43235493 1052.72469725 1053.01712078 1053.30962554 1053.60221154 1053.89487882 1054.1876274 1054.4804573 1054.77336854 1055.06636114 1055.35943513 1055.65259053 1055.94582736 1056.23914564 1056.5325454 1056.82602667 1057.11958945 1057.41323378 1057.70695968 1058.00076717 1058.29465627 1058.58862701 1058.88267941 1059.17681348 1059.47102926 1059.76532677 1060.05970603 1060.35416706 1060.64870988 1060.94333453 1061.23804101 1061.53282935 1061.82769958 1062.12265172 1062.41768579 1062.71280182 1063.00799982 1063.30327982 1063.59864184 1063.8940859 1064.18961204 1064.48522027 1064.7809106 1065.07668308 1065.37253771 1065.66847453 1065.96449355 1066.2605948 1066.5567783 1066.85304407 1067.14939214 1067.44582252 1067.74233525 1068.03893035 1068.33560783 1068.63236772 1068.92921004 1069.22613482 1069.52314208 1069.82023184 1070.11740413 1070.41465896 1070.71199637 1071.00941637 1071.30691898 1071.60450424 1071.90217216 1072.19992276 1072.49775607 1072.79567212 1073.09367091 1073.39175249 1073.68991686 1073.98816406 1074.28649411 1074.58490702 1074.88340283 1075.18198155 1075.48064322 1075.77938784 1076.07821545 1076.37712606 1076.67611971 1076.97519641 1077.27435619 1077.57359906 1077.87292506 1078.17233421 1078.47182652 1078.77140203 1079.07106075 1079.37080271 1079.67062794 1079.97053645 1080.27052826 1080.57060341 1080.87076191 1081.17100379 1081.47132907 1081.77173777 1082.07222992 1082.37280554 1082.67346465 1082.97420728 1083.27503345 1083.57594318 1083.8769365 1084.17801342 1084.47917398 1084.7804182 1085.08174609 1085.38315769 1085.68465301 1085.98623208 1086.28789492 1086.58964156 1086.89147202 1087.19338631 1087.49538448 1087.79746653 1088.09963249 1088.40188239 1088.70421624 1089.00663408 1089.30913592 1089.6117218 1089.91439172 1090.21714572 1090.51998381 1090.82290603 1091.12591239 1091.42900292 1091.73217765 1092.03543659 1092.33877976 1092.6422072 1092.94571893 1093.24931496 1093.55299532 1093.85676004 1094.16060914 1094.46454265 1094.76856058 1095.07266295 1095.3768498 1095.68112115 1095.98547702 1096.28991743 1096.59444241 1096.89905197 1097.20374615 1097.50852497 1097.81338845 1098.11833662 1098.42336949 1098.72848709 1099.03368945 1099.33897658 1099.64434852 1099.94980528 1100.2553469 1100.56097338 1100.86668476 1101.17248106 1101.47836231 1101.78432852 1102.09037972 1102.39651594 1102.70273719 1103.00904351 1103.31543491 1103.62191142 1103.92847306 1104.23511986 1104.54185184 1104.84866902 1105.15557143 1105.15557143 >>>