Re: How to dynamic insert more conditional statements into a function

2010-03-09 Thread Gabriel Genellina
En Tue, 09 Mar 2010 18:48:42 -0300, Shane escribió: Hi I am a newbie for Python Here is a question, say I have a list L, function foo is: def foo(L): if L[0] > 0: return True if later I want another function goo which returns "True" when L[0] and L[1] are both > 0, i.e., def goo(L):

Re: How to dynamic insert more conditional statements into a function

2010-03-09 Thread Emile van Sebille
On 3/9/2010 1:48 PM Shane said... Hi I am a newbie for Python Here is a question, say I have a list L, function foo is: def foo(L): if L[0]> 0: return True if later I want another function goo which returns "True" when L[0] and L[1] are both> 0, i.e., def goo(L): if L[0]> 0 and

How to dynamic insert more conditional statements into a function

2010-03-09 Thread Shane
Hi I am a newbie for Python Here is a question, say I have a list L, function foo is: def foo(L): if L[0] > 0: return True if later I want another function goo which returns "True" when L[0] and L[1] are both > 0, i.e., def goo(L): if L[0] > 0 and L[1] > 0: return True Can anybody tel