Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #76279 > unrolled thread
| Started by | luofeiyu <elearn2014@gmail.com> |
|---|---|
| First post | 2014-08-14 15:32 +0800 |
| Last post | 2014-08-14 15:32 +0800 |
| Articles | 1 — 1 participant |
Back to article view | Back to comp.lang.python
how to write a function to make operation as a argument in the function luofeiyu <elearn2014@gmail.com> - 2014-08-14 15:32 +0800
| From | luofeiyu <elearn2014@gmail.com> |
|---|---|
| Date | 2014-08-14 15:32 +0800 |
| Subject | how to write a function to make operation as a argument in the function |
| Message-ID | <mailman.12980.1408002867.18130.python-list@python.org> |
[Multipart message — attachments visible in raw view] — view raw
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?
Back to top | Article view | comp.lang.python
csiph-web