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
Shortest one should be:
bc = 'on' if c.page=='blog' else 'off'
Generally this might look a bit confusing, so you should only use it when it is clear what it means. Don't use it for big boolean clauses, since it begins to look ugly fast.