1

私は変数を持っています

sentence = "In 1794, shortly after his arrival in Manchester, Dalton was elected a member of the Manchester Literary and Philosophical Society, the "Lit & Phil", and a few weeks later he communicated his first paper on "Extraordinary facts relating to the vision of colours", in which he postulated that shortage in colour perception was caused by discoloration of the liquid medium of the eyeball. In fact, a shortage of colour perception in some people had not even been formally described or officially noticed until Dalton wrote about his own. Since both he and his brother were colour blind, he recognized that this condition must be hereditary."

現在、変数の値を閉じるため、これには "" と '' の両方が含まれる場合があります。これを防ぎたい。文字列を保存する他の方法はありますか?

4

3 に答える 3

4
a="""triple quoted strings can contain quote like this " without ending the string"""
于 2013-08-16T09:35:30.247 に答える
1

次のような三重引用符を使用できます。

sentence = """ long sentence with all 'kind" of symbols """
于 2013-08-16T09:35:11.520 に答える