Register Now

Login

Lost Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

What will be the output of the following Python code snippet?
def example(a):
a = a + ‘2’
a = a*2
return a
>>>example(“hello”)

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

Answer: a
Explanation: Python codes have to be indented properly.

Join The Discussion