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 ================================ >>> >>> main(example1) 136 >>> example1 ['one', 'hundred', 'thirty', 'five'] >>> ================================ RESTART ================================ >>> >>> main(example1) initial: ['one', 'hundred', 'thirty', 'five'] convert to cardinals [1, 100, 30, 5] final output 136 136 >>> ================================ RESTART ================================ >>> >>> main(example1) initial: ['one', 'hundred', 'thirty', 'five'] convert to cardinals [1, 100, 30, 5] item 5 total so far 5 item 30 total so far 35 item 100 total so far 135 item 1 total so far 136 final output 136 136 >>> ================================ RESTART ================================ >>> >>> main(example1) initial: ['one', 'hundred', 'thirty', 'five'] convert to cardinals [1, 100, 30, 5] item 1 total so far 1 item 100 total so far 101 item 30 total so far 131 item 5 total so far 136 final output 136 136 >>> ================================ RESTART ================================ >>> >>> main(example1) initial: ['one', 'hundred', 'thirty', 'five'] convert to cardinals [1, 100, 30, 5] item 1 total so far 0 item 100 total so far 100 item 30 total so far 100 item 5 total so far 105 final output 105 105 >>> ================================ RESTART ================================ >>> >>> main(example1) initial: ['one', 'hundred', 'thirty', 'five'] convert to cardinals [1, 100, 30, 5] item 1 total so far 0 item 100 total so far 0 item 30 total so far 30 item 5 total so far 35 final output 35 35 >>> ================================ RESTART ================================ >>> >>> main(example1) initial: ['one', 'hundred', 'thirty', 'five'] convert to cardinals [1, 100, 30, 5] item 1 total so far 0 item 100 total so far 0 item 30 total so far 130 item 5 total so far 130 final output 130 130 >>> ================================ RESTART ================================ >>> >>> main(example1) initial: ['one', 'hundred', 'thirty', 'five'] convert to cardinals [1, 100, 30, 5] item 1 store 0 total so far 0 item 100 store 100 total so far 0 item 30 store 0 total so far 130 item 5 store 0 total so far 130 final output 130 130 >>> ================================ RESTART ================================ >>> >>> main(example1) initial: ['one', 'hundred', 'thirty', 'five'] convert to cardinals [1, 100, 30, 5] item 1 store 0 total so far 1 item 100 store 100 total so far 1 item 30 store 0 total so far 131 item 5 store 0 total so far 136 final output 136 136 >>> ================================ RESTART ================================ >>> >>> main(example1) initial: ['one', 'hundred', 'thirty', 'five'] convert to cardinals [1, 100, 30, 5] item 1 store 1 total so far 0 item 100 store 100 total so far 1 item 30 store 0 total so far 3000 item 5 store 5 total so far 3000 final output 3005 3005 >>> ================================ RESTART ================================ >>> >>> main(example1) initial: ['one', 'hundred', 'thirty', 'five'] convert to cardinals [1, 100, 30, 5] item 1 store 1 total so far 0 item 100 store 100 total so far 1 item 30 store 0 total so far 3001 item 5 store 5 total so far 3001 final output 3006 3006 >>> ================================ RESTART ================================ >>> >>> main(example1) initial: ['one', 'hundred', 'thirty', 'five'] convert to cardinals [1, 100, 30, 5] item 1 store 1 total so far 0 item 100 store 100 total so far 1 here: 30 0 3001 item 30 store 0 total so far 3001 item 5 store 5 total so far 3001 final output 3006 3006 >>> ================================ RESTART ================================ >>> >>> main(example1) initial: ['one', 'hundred', 'thirty', 'five'] convert to cardinals [1, 100, 30, 5] item 1 store 1 total so far 0 item 100 store 0 total so far 100 item 30 store 30 total so far 100 item 5 store 5 total so far 130 final output 135 135 >>> ================================ RESTART ================================ >>> >>> main(example2) initial: ['two', 'thousdan', 'three', 'hundred', 'five'] convert to cardinals [2, None, 3, 100, 5] item 2 store 2 total so far 0 Traceback (most recent call last): File "", line 1, in main(example2) File "/Users/adam/Desktop/Summer 2011 Scripts/number_word_001.py", line 113, in main output = convert_number_list2(output) File "/Users/adam/Desktop/Summer 2011 Scripts/number_word_001.py", line 96, in convert_number_list2 elif current > store: TypeError: unorderable types: NoneType() > int() >>> ================================ RESTART ================================ >>> >>> main(example2) initial: ['two', 'thousand', 'three', 'hundred', 'five'] convert to cardinals [2, 1000, 3, 100, 5] item 2 store 2 total so far 0 item 1000 store 0 total so far 2000 item 3 store 3 total so far 2000 item 100 store 0 total so far 2300 item 5 store 5 total so far 2300 final output 2305 2305 >>> main(['two','hundred','five','thousand','three','hundred','seventy']) initial: ['two', 'hundred', 'five', 'thousand', 'three', 'hundred', 'seventy'] convert to cardinals [2, 100, 5, 1000, 3, 100, 70] item 2 store 2 total so far 0 item 100 store 0 total so far 200 item 5 store 5 total so far 200 item 1000 store 0 total so far 5200 item 3 store 3 total so far 5200 item 100 store 0 total so far 5500 item 70 store 70 total so far 5500 final output 5570 5570 >>> ================================ RESTART ================================ >>> >>> word_list_to_number(sample4) ['one', 'million', 'two', 'hundred', 'two', 'thousand', 'thirty', 'three'] [1, 1000000, 2, 100, 2, 1000, 30, 3] [1, 1000000, 202, 1000, 33] 1202033 >>> ================================ RESTART ================================ >>> >>> process_group(['two','hundred','thirty','five']) Traceback (most recent call last): File "", line 1, in process_group(['two','hundred','thirty','five']) File "/Users/adam/Desktop/Summer 2011 Scripts/number-program.py", line 88, in process_group outlist = handle_multiplication_cases(number_list) File "/Users/adam/Desktop/Summer 2011 Scripts/number-program.py", line 78, in handle_multiplication_cases outlist.append(store*item) TypeError: can't multiply sequence by non-int of type 'str' >>> process_group([2,100,30,5]) [200, 30, 5] 235 >>> process_group([1, 1000000, 202, 1000, 33]) [1000000, 202000, 33] 1202033 >>> character_list_to_number(sample6) ['九', '千', '二', '萬', '二', '千', '三', '百', '二', '十', '一'] [9, 1000, 2, 10000, 2, 1000, 3, 100, 2, 10, 1] [9000, 2] [2000, 300, 20, 1] [9002, 10000, 2321] [90020000, 2321] 90022321 >>> while(not (output == 'yes') or (output == 'no'): output=(input(“Please respond: 'yes' or 'no')) SyntaxError: invalid syntax >>> while(not (output == 'yes') or (output == 'no')): output=(input(“Please respond: 'yes' or 'no')) SyntaxError: invalid character in identifier >>> while(not (output == 'yes') or (output == 'no')): output=(input("Please respond: 'yes' or 'no'")) if output == 'yes': return(True) SyntaxError: 'return' outside function >>> while(not (output == 'yes') or (output == 'no')): output=(input("Please respond: 'yes' or 'no'")) if output == 'yes': return(True) SyntaxError: invalid syntax >>> def yes_or_no(): while(not (output == 'yes') or (output == 'no')): output=(input("Please respond: 'yes' or 'no'")) if output == 'yes': return(True) else: return(False) >>> yes_or_no() Traceback (most recent call last): File "", line 1, in yes_or_no() File "", line 2, in yes_or_no while(not (output == 'yes') or (output == 'no')): UnboundLocalError: local variable 'output' referenced before assignment >>> def yes_or_no(): output = '' while(not (output == 'yes') or (output == 'no')): output=(input("Please respond: 'yes' or 'no'")) if output == 'yes': return(True) else: return(False) >>> yes_or_no() Please respond: 'yes' or 'no'YES Please respond: 'yes' or 'no'y Please respond: 'yes' or 'no'iii Please respond: 'yes' or 'no'maybe Please respond: 'yes' or 'no'yes True >>> ================================ RESTART ================================ >>> >>> question1() Traceback (most recent call last): File "", line 1, in question1() TypeError: 'str' object is not callable >>> ================================ RESTART ================================ >>> >>> question1() Traceback (most recent call last): File "", line 1, in question1() TypeError: 'str' object is not callable >>> ================================ RESTART ================================ >>> >>> question_1() 5*5*5**5 5 5 >>> question_2() '9876543210' >>> question_3() output equals: 350.0 >>> question_4() output equals 35 after the loop executes >>> question5() Traceback (most recent call last): File "", line 1, in question5() TypeError: 'str' object is not callable >>> question_5() * * * * * * * >>> ================================ RESTART ================================ >>> >>>