One line assignment is ok, but, seems like you can't perform actions.

#the following will work:
I = 1 if True else 2

#but the following will generate an error:
if I == 1: print("one")

And, not sure if/how to work around that second one myself.

Stay well

Jacob Kruger
Blind Biker
Skype: BlindZA
"Roger Wilco wants to welcome you...to the space janitor's closet..."

----- Original Message ----- From: "JC" <chalao.a...@gmail.com>
Newsgroups: comp.lang.python
To: <python-list@python.org>
Sent: Thursday, December 25, 2014 5:18 PM
Subject: If One Line


Hello,

Is it possible in python:

if ((x = a(b,c)) == 'TRUE'):
print x

Thanks.
--
https://mail.python.org/mailman/listinfo/python-list

--
https://mail.python.org/mailman/listinfo/python-list

Reply via email to