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
Well, not being a python guy please take this with a huge grain of salt, but having written (and, with more difficulty, read) a lot of clever code over the years, I find myself with a strong preference now for readable code. I got the gist of what your original code was doing even though I'm a nobody as a Python guy. To be sure, you could hide it and maybe impress a Python wonk or two, but why?