I am on exercise 8 of Learning Python the Hard Way, and I don't understand why certain lines in a print
function are printed in single or double quotes.
The program reads as follows:
formatter = "%r %r %r %r"
print formatter % (
"I had this thing.",
"That you could type up right.",
"But it didn't sing.",
"So I said goodnight."
)
The output is as follows:
'I had this thing.' 'That you could type up right.' "But it didn't sing." 'So I said goodnight.'
Why is the third sentence in double quotes and why are the others in single quotes?