podwójne cudzysłowy w reprezentacji ciągu
Ten fragment:
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."
)
po uruchomieniu wypisuje ten ciąg:
'I had this thing.' 'That you could type up right.' "But it didn't sing." 'So I said goodnight.'
Dlaczego zrobił"But it didn't sing."
umieścić w podwójnym cudzysłowie, gdy pozostałe trzy elementy były w pojedynczych cudzysłowach?
(Ten kod pochodzi zDowiedz się Python the Hard Way Ćwiczenie 8.)