MCQs
Total Questions : 13
| Page 1 of 2 pages
Answer: Option C. -> Error
Cannot concantenate str and int objects.
Answer: Option C. -> Error
Strings cannot be modified.
Answer: Option B. -> \nhello
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.
Answer: Option B. -> * abcdef *
Padding is done towards the left-hand-side first when the final string is of odd length. Extra spaces are present since we haven't overridden the value of sep.
Answer: Option B. -> i.__add__(j)
Execute in shell to verify.
Answer: Option A. -> True
The string has only letters.
Answer: Option A. -> The sum of 2 and 10 is 12
The arguments passed to the function format can be integers also.
Answer: Option B. -> 0
Counts the number of times the sub-string 'xyy' is present in the given string, starting from position 2 and ending at position 11.
Answer: Option A. -> Hello foo and bin
The numbers 0 and 1 represent the position at which the strings are present.
Answer: Option B. -> False
The character . is not a numeric character.