@@ -5,8 +5,8 @@ def main():
55 assert len (sys .argv ) == 4 , 'Need exactly 3 arguments'
66
77 operator = sys .argv [1 ]
8- assert operator in ['add' , 'subtract' , 'multiply' , 'divide' ], (
9- 'Operator is not one of add, subtract, multiply, or divide: '
8+ assert operator in ['-- add' , '-- subtract' , '-- multiply' , '-- divide' ], (
9+ 'Operator is not one of -- add, -- subtract, -- multiply, or -- divide: '
1010 'bailing out' )
1111 try :
1212 operand1 , operand2 = float (sys .argv [2 ]), float (sys .argv [3 ])
@@ -19,13 +19,13 @@ def main():
1919
2020def do_arithmetic (operand1 , operator , operand2 ):
2121
22- if operator == 'add' :
22+ if operator == '-- add' :
2323 value = operand1 + operand2
24- elif operator == 'subtract' :
24+ elif operator == '-- subtract' :
2525 value = operand1 - operand2
26- elif operator == 'multiply' :
26+ elif operator == '-- multiply' :
2727 value = operand1 * operand2
28- elif operator == 'divide' :
28+ elif operator == '-- divide' :
2929 value = operand1 / operand2
3030 print (value )
3131
0 commit comments