R

Ranjeet • 34.60K Points
Instructor I

Q. what will be the output of the following
Python code snippet?
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
Share

Explanation by: Ranjeet
python codes have to be indented properly.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.


Question analytics