formatter = "%r %r %r %r"
print formatter % (1, 2, 3, 4)
print formatter % (True, False, False, True)
print formatter % (formatter, formatter, formatter, formatter)
print formatter % (
"I had this thing.",
"That you could type up right.",
"But it didn't sing.",
"So I said goodnight."
It's a duplicate and it's because you're using raw representation of string. So let's see
For this sentence
"I had this thing." output will be single or double quoted because there is not single/double qoutes inside string, the only string containing double quoted output will be
"But it didn't sing." because it already contains single quotes inside it :)
If you were using %s , you would see only the string without quotes :)