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

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

Answer: a
Explanation: All occurrences of the first substring are replaced by the second substring.

Join The Discussion