item = ['time is money']
def one():
if 'cake' in item[0]:
return 'love it too'
def two():
if 'time' in item[0]:
return 'keep time'
def three():
if 'cook' in item[0]:
return 'love cooking too'
def four():
if 'given' in item[0]:
return 'dont give in'
def five():
if 'admin' in item[0]:
return 'administered too'
fnval = ['i', 'we', 'cake', 'love', 'time', ]
fadmin = ['admin','give',]
G3 = [one(), two(), three()]
G4 = [four(), five()]
l = []
def testing():
del l[:]
b = False
for c in fnval or fadmin:
b = b | (item[0].find(c) != -1)
if b:
for (func) in G3:
l.append((func))
for (func) in G4:
l.append((func))
print [x for x in l if x is not None]
if __name__=='__main__':
testing()--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
You received this message because you are subscribed to the Google Groups "web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to web2py+un...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Anthony
Note, Idle is not giving you a return value - the function is simply printing the output, which Idle displays. Of you want a return value, you must return something.
Anthony
--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
You received this message because you are subscribed to a topic in the Google Groups "web2py-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/web2py/i1Etezn1YXU/unsubscribe.
To unsubscribe from this group and all its topics, send an email to web2py+un...@googlegroups.com.