On Apr 24, 5:00 am, GC-Martijn <gcmart...@gmail.com> 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. > > def Test(): > return 'Vla' > > I searching something like this: > > if (t = Test()) == 'Vla': > print t # Vla >
Here is a thread from 3 weeks ago on this very topic, with a couple of proposed solutions. http://groups.google.com/group/comp.lang.python/browse_frm/thread/9f8e79fa28d69905/e934c73ee3c2dbc2?hl=en&q= -- Paul -- http://mail.python.org/mailman/listinfo/python-list