Python code?
>>> str1 = 'hello'
>>> str2 = ','
>>> str3 = 'world'
>>> str1[-1:]
Explanation: -1 corresponds to the last index.
Dear candidates you will find MCQ questions of Problem Solving and Python Programming here. Learn these questions and prepare yourself for coming examinations and interviews. You can check the right answer of any question by clicking on any option or by clicking view answer button.
Explanation: -1 corresponds to the last index.
Explanation: + is used to concatenate and * is used to multiply strings.
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.
Explanation: string literal separated by whitespace are allowed. they are concatenated.
Explanation: execute in shell to verify.
Explanation: 0xa and 0xb and 0xc are hexadecimal integer literals representing the decimal values 10, 11 and 12 respectively. there sum is 33.
Explanation: self.o1 was never created.
Explanation: id in this case will be the attribute of the class.
Explanation: execute in the shell and verify.
Explanation: strings cannot be modified.
Jump to