>>> secret = 'foo' >>> result = 'got it' if secret=='foo' else 'try again' >>> print result 'got it'