最佳答案
我有下面的代码
test = "have it break."
selectiveEscape = "Print percent % in sentence and not %s" % test
print(selectiveEscape)
我想要得到输出:
Print percent % in sentence and not have it break.
实际发生了什么:
selectiveEscape = "Use percent % in sentence and not %s" % test
TypeError: %d format: a number is required, not str