python 笔迹1
#coding:utf-8 ''' Created on 2015.3.22 @author: ZQM ''' from __future__ import division def jia(x,y): return x+y; def jian(x,y): return x-y def cheng(x,y): return x*y; def chu(x,y): return x/y; operator = {'+':jia, '-':jian, '*':cheng, '/':chu}; #print operator["/"](3,2) ; def f(x,o,y): print operator.get(o)(3,2) f(3,'-',2)