Re: how to write a function to make operation as a argument in the function

2014-08-14 Thread Mark Lawrence
On 14/08/2014 08:32, luofeiyu wrote: I want to write a function to make operation as a argument in the function. |def fun(op,x,y): return(x op y)| it is my target for the funciton: if op ="+" fun(op,3,9) =12 if op ="*" fun(op,3,9) =27 How to write it? With a text editor after you've

how to write a function to make operation as a argument in the function

2014-08-14 Thread luofeiyu
I want to write a function to make operation as a argument in the function. |def fun(op,x,y): return(x op y)| it is my target for the funciton: if op ="+" fun(op,3,9) =12 if op ="*" fun(op,3,9) =27 How to write it? -- https://mail.python.org/mailman/listinfo/python-list