Can we have assignment in a condition?

Posted by Vishal on Stack Overflow See other posts from Stack Overflow or by Vishal
Published on 2010-04-08T22:45:49Z Indexed on 2010/04/08 22:53 UTC
Read the original article Hit count: 147

Filed under:

Hi,

Is it possible to have assignment in a condition?

For ex.

if (a=some_func()):
    # Use a

© Stack Overflow or respective owner

Related posts about python