Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 186188d

Browse files
committed
#1530012: move TQS section before raw strings.
1 parent 1a1158f commit 186188d

1 file changed

Lines changed: 14 additions & 15 deletions

File tree

Doc/tutorial/introduction.rst

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -199,21 +199,6 @@ the following::
199199
several lines of text just as you would do in C.
200200
Note that whitespace at the beginning of the line is significant.
201201

202-
If we make the string literal a "raw" string, however, the ``\n`` sequences are
203-
not converted to newlines, but the backslash at the end of the line, and the
204-
newline character in the source, are both included in the string as data. Thus,
205-
the example::
206-
207-
hello = r"This is a rather long string containing\n\
208-
several lines of text much as you would do in C."
209-
210-
print hello
211-
212-
would print::
213-
214-
This is a rather long string containing\n\
215-
several lines of text much as you would do in C.
216-
217202
Or, strings can be surrounded in a pair of matching triple-quotes: ``"""`` or
218203
``'''``. End of lines do not need to be escaped when using triple-quotes, but
219204
they will be included in the string. ::
@@ -230,6 +215,20 @@ produces the following output::
230215
-h Display this usage message
231216
-H hostname Hostname to connect to
232217

218+
If we make the string literal a "raw" string, ``\n`` sequences are not converted
219+
to newlines, but the backslash at the end of the line, and the newline character
220+
in the source, are both included in the string as data. Thus, the example::
221+
222+
hello = r"This is a rather long string containing\n\
223+
several lines of text much as you would do in C."
224+
225+
print hello
226+
227+
would print::
228+
229+
This is a rather long string containing\n\
230+
several lines of text much as you would do in C.
231+
233232
The interpreter prints the result of string operations in the same way as they
234233
are typed for input: inside quotes, and with quotes and other funny characters
235234
escaped by backslashes, to show the precise value. The string is enclosed in

0 commit comments

Comments
 (0)