Is there a way to add a conditional string in Python's advance string formatting "foo {}".format(bar)?

python, string

Solution

print "You can {} that step!".format('check' if checked else 'uncheck')

Problem

For example I have a line of code like this ``` if checked: checked_string = "check" else: checked_string = "uncheck" print "You can {} that step!".format(checked_string) ``` Is there a shortcut to this? I was just curious.

Original source