On 24 apr, 12:15, Chris Rebert wrote:
> On Fri, Apr 24, 2009 at 3:00 AM, GC-Martijn wrote:
> > Hello,
>
> > I'm trying to do a if statement with a function inside it.
> > I want to use that variable inside that if loop , without defining it.
>
> > d
On 24 apr, 12:11, Steven D'Aprano wrote:
> On Fri, 24 Apr 2009 03:00:26 -0700, GC-Martijn wrote:
> > Hello,
>
> > I'm trying to do a if statement with a function inside it. I want to use
> > that variable inside that if loop , without defining it.
>
> &g
Hello,
I'm trying to do a if statement with a function inside it.
I want to use that variable inside that if loop , without defining it.
def Test():
return 'Vla'
I searching something like this:
if (t = Test()) == 'Vla':
print t # Vla
or
if (t = Test()):
print t # Vla
---