| Python 2.2 für Einsteiger | ||
|---|---|---|
| <<< Previous | Einführung anhand von Beispielen | Next >>> |
#!/usr/bin/python2.2
from math import sin, cos
def compose(fun1, fun2):
def inner(x):
return fun1(fun2(x))
return inner
def fun1(x):
return x + " world!"
def fun2(x):
return "Hello,"
sincos = compose(sin,cos)
f=sincos
print f(3)
| <<< Previous | Home | Next >>> |
| Iteratoren | Up | Primzahlen |