Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #76279 > unrolled thread

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

Started byluofeiyu <elearn2014@gmail.com>
First post2014-08-14 15:32 +0800
Last post2014-08-14 15:32 +0800
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python


Contents

  how to write a function to make operation as a argument in the function luofeiyu <elearn2014@gmail.com> - 2014-08-14 15:32 +0800

#76279 — how to write a function to make operation as a argument in the function

Fromluofeiyu <elearn2014@gmail.com>
Date2014-08-14 15:32 +0800
Subjecthow 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?

[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web