This snippet:
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."
)
when run, prints this string:
'I had this thing.' 'That you could type up right.' "But it didn't sing." 'So I said goodnight.'
Why did "But it didn't sing."
get put in double quotes when the other three items were in single quotes?
(This code is taken from Learn Python the Hard Way Exercise 8.)
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…