Question
def example(a):
a = a + '2'
a = a*2
return a
>>>example("hello")
a.
indentation Error
b.
cannot perform mathematical operation on strings
c.
hello2
d.
hello2hello2
Posted under Python
Engage with the Community - Add Your Comment
Confused About the Answer? Ask for Details Here.
Know the Explanation? Add it Here.
Q. Carefully observe the code and give the answer.
Similar Questions
Discover Related MCQs
Q. What data type is the object below ?
L = [1, 23, ‘hello’, 1].
View solution
Q. In order to store values in terms of key and value we use what core data type.
View solution
Q. Which of the following results in a SyntaxError ?
View solution
Q. The following is displayed by a print function call:
tom
dick
harry
Select all of the function calls that result in this output
View solution
Q. Select all options that print:
hello-how-are-you
View solution
Q. What is the return value of trunc() ?
View solution
Q. What is the output of print 0.1 + 0.2 == 0.3?
View solution
Q. Which of the following is not a complex number?
View solution
Q. What is the type of inf?
View solution
Q. What does ~4 evaluate to?
View solution
Q. What does ~~~~~~5 evaluate to?
View solution
Q. Which of the following is incorrect?
View solution
Q. What is the result of cmp(3, 1)?
View solution
Q. Which of the following is incorrect?
View solution
Q. What is the result of round(0.5) – round(-0.5)?
View solution
Q. What does 3 ^ 4 evaluate to?
View solution
Q. The value of the expressions 4/(3*(2-1)) and 4/3*(2-1) is the same. State whether true or false.
View solution
Q. The value of the expression:
4 + 3 % 5
View solution
Q. Which of the following expressions involves coercion when evaluated in Python?
View solution
Q. Which of the following expressions is an example of type conversion?
View solution
Suggested Topics
Are you eager to expand your knowledge beyond Python? We've curated a selection of related categories that you might find intriguing.
Click on the categories below to discover a wealth of MCQs and enrich your understanding of Computer Science. Happy exploring!