sys模块 import sys def _add(a, b): return a + b def _sub(a, b): return a - b def _mul(a, b): return a * b def _div(a, b): return a / b def caculate(num1, num2, op): '''四则运算''' ''' op_ls = ['+', '-', 'x', '/'] fun_ls = [_add, _sub, _mul, _div] for i in…