Q.

What will be the output of the following Python code? >>>print (r"\nhello")

A. a new line and hello
B. \\nhello
C. the letter r and then hello
D. error
Answer» B. \\nhello
Explanation: when prefixed with the letter ‘r’ or ‘r’ a string literal becomes a raw string and the escape sequences such as \n are not converted.
1.5k
0
Do you find this helpful?
3

Discussion

No comments yet