
August 11th, 2012, 02:12 PM
|
|
Registered User
|
|
Join Date: Aug 2012
Posts: 1
Time spent in forums: 25 m 33 sec
Reputation Power: 0
|
|
|
Odd double-quote
Why does this:
Code:
formatter = "%r %r %r %r"
print formatter % (1, 2, 3, 4)
print formatter % ("one", "two", "three", "four")
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."
)
, when ran, gives this string : "But it didn't sing." as double quotes and the rest as single quotes?
Quote: | This code is taken from http://learnpythonthehardway.org exercise 8. |
|