

McqMate
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. |
View all MCQs in
Problem Solving and Python ProgrammingNo comments yet