So I went through the "Learn Python Hard Way"
and wherein:
formatter = "%r %r %r %r" print formatter % ( "I had this thing.", "That you could up right.", "But it didn't sing.", "So I said goodnight" )
there was a way out
'I had this thing.' 'That you could up right.' "But it didn't sing." 'So I said goodnight'
But I'm not sure why the third line has double lines.
"a"and 'a'- the same lines, no difference.
"a"
'a'
The third line contains an apostrophe, therefore it cannot be represented as 'But it didn't sing.', because it would end the line after didnand raise SyntaxError.
'But it didn't sing.'
didn
SyntaxError
If you want to represent a string with a single quote, you can do this:
"'"
or
'\''
Same thing with a double quote:
'"'
"\""
If you have a string with both quotes, you can select one of them:
'"\'"
"\"'"
'But it didn't sing' - - , , , ( " , ), - 1. 'But it didn' 2. 't sing', .
'But it didn't sing'
'But it didn'
't sing'
, , "" , , , , , , , , .. .
', ". ' # 3, ' string '. , .
'
"
Source: https://habr.com/ru/post/1622878/More articles:How to call overload method in java - javaЛогика перегрузки вызова метода Java - javaКак узнать, когда пользователь скопировал что-то в буфер обмена в Android? - androidBranch.io disable the right arrow button ("bnc.lt") on the StatusBar - iosCompute PySpark DataFrame column mode? - pythonWhen to use declarative programming over imperative programming - declarativeКак сделать векторный вектор приложения переопределить вектор библиотеки? - androidДобавление пространства между ячейками в разделе в swift 2 - iosParsing a python re.sub request - pythonYii2: compare start and end time of input in a table / array - javascriptAll Articles