There is a boolean variable. I need to check its value and, depending on this, change the arguments passed to print.
amusingsize = True print ("Amusing size: %s") %(if(amusingsize) "GB" else "MB")
How can you do this? I do not want to fence unnecessary if / else blocks.
print "Amusing size: " . (amusingsize ? "GB" : "MB")
print "Amusing size: " . (amusingsize ? "GB" : "MB")
but you have Python, so suffer without comfortable ternary C-like operators) - wirtwelt