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?
print(‘abef’.replace(‘cd’, ’12’))

What will be the output of the following Python code snippet?
print(‘abef’.replace(‘cd’, ’12’))
a) abef
b) 12
c) error
d) none of the mentioned

Answer: a
Explanation: The first substring is not present in the given string and hence nothing is replaced.

Join The Discussion