#Combine %r with double-quote and single-quote escapes and print them out.
#Compare %r with %s. Notice how %r prints it the way you'd write it in your file,
#but %s prints it the way you'd like to see it?
これは私が演習のために書いたものです:
1) mybugs1 = "Guido said: %r and moved on." %'I \'love\' \"my\" bugs'
2) mybugs2 = "Stallman said: %s and moved on." % 'I \'love\' \"my\" bugs'
3) print mybugs1
4) print mybugs2
出力
Guido said: 'I \'love\' "my" bugs' and moved on.
Stallman said: I 'love' "my" bugs and moved on.
質問
%r は、.py ファイルに記述した方法ですべてを出力するわけではありません (たとえば、1 行目の \"my\" ではなく "my" を出力します)。なんで?