I have this
bc = \'off\' if c.page == \'blog\': bc = \'on\' print(bc)
Is there a more pythonic (and/or shorter) way of writing this in Pyth
You can use,
a = b if c else d
but if you are using a python version prior to 2.5,
bc = c.page == "blog" and "on" or "off"
can do the trick also.