your testing function dont have return.

Em dom, 24 de jun de 2018 6:09 PM, Maurice Waka <[email protected]>
escreveu:

> I have bee using python Idle for some time and with the code below, though
> not perfected, am able to get an answer(return value as expected). If I
> import it to web2py, the return value becomes None. I don't know where I
> have gone wrong. Here is the code:
> 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()
> I want to get the same return value as one would on python idle, and not a
> null value.
> regards
>
> --
> 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 [email protected].
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to